我想要一个转储日志并在插入 USB 大容量存储器后立即开始登录的脚本(上面有文件“OKdump”)。如果检测到任何异常(如视觉上存在的错误),我想要它可以截取屏幕截图并将其保存在同一驱动器上。
Similar to question How to log CPU load?, I would like to log memory of a process.
The process I want to log, is killed on a remote server, and I want to find out the CPU load and the memory usage just before it was killed.
[update]
Both Stefano Palazzo's neat little python script and
Micha?'s one line output values that are smaller than in top for CPU and Mem. Do you have an idea why?
output top: …
这个UFW日志是什么意思?已经问了一个类似的问题,但我想明确地知道 UFW 日志的每一行是什么意思
Feb 6 16:27:08 jonasgroenbek kernel: [71910.873115]
[UFW BLOCK] IN=eth0 OUT=
MAC=a6:8d:e2:51:62:4c:f0:4b:3a:4f:80:30:08:00
SRC=77.72.85.26 DST=157.230.26.180
LEN=40 TOS=0x00 PREC=0x00 TTL=251 ID=62215 PROTO=TCP
SPT=42772 DPT=3194 WINDOW=1024
RES=0x00 SYN URGP=0
Run Code Online (Sandbox Code Playgroud)
对于我(希望其他人)的可行性,我非常希望每个单独的部分都能得到简短的描述。
MySQL Binlog 文件数量日益增加,其大小以 GB 为单位增加。如何阻止 binlog 文件大小不断增加?它们正在填满磁盘空间。
我正在寻找一种方法来记录和监控我的服务器硬件温度和负载(例如 CPU 或 RAM)。我该怎么做?
目标是:
好的,我可以使用任务栏中的小程序之一,但是日志记录呢?
我目前正在尝试将 systemd 单元制作为 Web 服务器。目前,我的foo.service文件如下所示:
[Unit]
Description=The Foo Web Server
[Service]
Type=simple
ExecStart=/opt/foo/.cabal-sandbox/bin/foo
[Install]
WantedBy=multi-user.target
Run Code Online (Sandbox Code Playgroud)
该foo可执行文件自动记录所有的HTTP请求到标准输出-这是很好的测试。但是,当我查看日志时journalctl -u foo,我只能得到这样的输出:
...
May 06 17:46:57 localhost systemd[1]: Stopping The Foo Web Server...
May 06 17:46:57 localhost systemd[1]: Started Foo Web Server.
May 06 17:46:57 localhost systemd[1]: Starting The Foo Web Server...
May 06 17:47:08 localhost systemd[1]: Stopping The Foo Web Server...
May 06 17:47:08 localhost systemd[1]: Started The Foo Web Server.
May 06 17:47:08 localhost systemd[1]: Starting …Run Code Online (Sandbox Code Playgroud) 这是我的系统日志消息的示例输出/var/log/syslog:
Nov 15 20:20:48 ubuntu winbindd[915]: [2011/11/15 20:20:48.940063, 0] winbindd/idmap_tdb.c:287(idmap_tdb_open_db)
Nov 15 20:20:48 ubuntu winbindd[915]: Upgrade of IDMAP_VERSION from -1 to 2 is not possible with incomplete configuration
Run Code Online (Sandbox Code Playgroud)
我如何查看消息级别,例如信息、警告、错误等?
我正在使用带有 rsyslog 包版本 5.8.1-1ubuntu2 的 Ubuntu 10.04 LTS。
我在新的 Ubuntu Lucid 服务器上安装了 awstats,但是当 cron 尝试以 user 身份运行它时www-data,它会抱怨cannot access /var/log/apache2/access.log: Permission denied.
在/usr/share/doc/awstats/README.Debian有这一段:
默认情况下,Apache 存储(自版本 1.3.22-1 起)带有 uid=root 和 gid=adm 的日志文件,因此您需要...
1) 更改 /etc/logrotate.d/apache 中日志文件的权限,以便 www-data 至少具有读取权限。
2) 与 1) 一样,但更改为特定用户,并使用 Apache 的 suEXEC 功能以同一用户身份运行(并更改 /var/lib/awstats 的权限或使用其他目录)。这更复杂,但是服务器通常无法访问日志(这可能是 Apache 默认的点)。
3) 将 awstats.pl 更改为 group adm(但请注意,您将冒着允许 CGI 脚本访问机器上的管理内容的风险!)。
我会选择 1,但是推荐的授予权限是什么?
我访问了 30 多个关于同一问题的不同论坛问题,但没有一个能够为我指明正确的方向。
我不在乎是什么导致了这个问题。我不在乎错误消息说了什么。
我想完全禁止这种情况发生。
我不想仅禁用这个 .xsession-errors 文件在我的系统上的所有日志记录。
I have tried the /dev/null thing it doesn't work. I made it read-only, just creates a new file .xsession-errors.jkhbjhjh. I even commented out the file generation in /etc/X11/xsession.
I'm running an ecommerce webserver that will be decommissioned in less than 90 days. I just need to keep the sites up long enough to get them all moved over to my new system. This log file is filling up my HDD 2 to …
我有时会收到很多这些 AUDIT 日志条目
...
[UFW AUDIT] IN= OUT=eth0 SRC=176.58.105.134 DST=194.238.48.2 LEN=76 TOS=0x10 PREC=0x00 TTL=64 ID=32137 DF PROTO=UDP SPT=36231 DPT=123 LEN=56
[UFW ALLOW] IN= OUT=eth0 SRC=176.58.105.134 DST=194.238.48.2 LEN=76 TOS=0x10 PREC=0x00 TTL=64 ID=32137 DF PROTO=UDP SPT=36231 DPT=123 LEN=56
[UFW AUDIT] IN= OUT=lo SRC=192.168.192.254 DST=192.168.192.254 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=54579 DF PROTO=TCP SPT=59488 DPT=30002 WINDOW=32792 RES=0x00 SYN URGP=0
[UFW AUDIT] IN=lo OUT= MAC=00:00:00:00:00:00:00:00:00:00:00:00:08:00 SRC=192.168.192.254 DST=192.168.192.254 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=54579 DF PROTO=TCP SPT=59488 DPT=30002 WINDOW=32792 RES=0x00 SYN URGP=0
[UFW AUDIT] IN=lo OUT= MAC=00:00:00:00:00:00:00:00:00:00:00:00:08:00 …Run Code Online (Sandbox Code Playgroud) logging ×10
log ×4
cpu-load ×2
firewall ×2
ufw ×2
15.04 ×1
apache2 ×1
command-line ×1
hardware ×1
mass-storage ×1
memory-usage ×1
monitor ×1
mysql ×1
permissions ×1
rsyslog ×1
screenshot ×1
scripts ×1
server ×1
stdout ×1
systemd ×1
temperature ×1