我想知道哪个进程更改了某个目录中的文件。
我查看了 inotify-tools,但它没有显示 pid。我还查看了 fileschanged 实用程序,但就我而言,它根本没有显示任何内容,即使发生了更改。
有解决方案吗?
有时,我计算机上的其他用户会使用我的帐户。我想知道他们用 GUI 以简单的方式做了什么。我不想阅读日志之类的东西。
有这样的工具吗?如果是,请说出姓名。
我想在更改任何设置期间监视文件/文件更改。我可以通过使用来监控更改,dconf watch /但此命令只是监控设置路径,我希望它的文件不是架构路径。是否有任何工具/命令来监视文件更改?
我只想要/path/to/filename监控的结果。
例如,我想知道更改亮度设置后哪个文件发生了变化。
我按照本教程安装了 nagios http://sharadchhetri.com/2014/02/08/install-and-configure-nagios-core-4-on-ubuntu-12-04-lts/
在启动 nagios 和 apache2 并浏览到 nagios 管理门户时,我看到如下错误
(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_ping)
(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_http)
(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_users)
Run Code Online (Sandbox Code Playgroud) 我在互联网上环顾四周,寻找是否已经有一种方法可以对可执行文件/脚本的某个部分进行计时以查看该部分需要多长时间,但我发现的只是文件外部的更多信息。所以我想输入一行启动计时器,并在部分结束时停止计时器并向我显示经过的时间,而不是全部,而只是一部分。
例子:
#!/bin/sh
IPTABLES="/sbin/iptables"
BLOCKEDIPS_XS=/root/iptables/iptables/blockxs.zone
$IPTABLES -F
$IPTABLES -F INPUT
$IPTABLES -F OUTPUT
$IPTABLES --delete-chain
$IPTABLES -F FORWARD
$IPTABLES -F -t mangle
$IPTABLES -F -t nat
$IPTABLES -X
timer start
/bin/egrep -v "^#|^$" $BLOCKEDIPS_XS | while IFS= read -r ip
do
# Append everything to droplist
$IPTABLES -A droplist -i eth0 -s $ip -j LOG --log-prefix " Drop IP List blockxs "
$IPTABLES -A droplist -i eth0 -s $ip -j DROP
done <"$BLOCKEDIPS_XS"
timer stops, shows elapsed time
Run Code Online (Sandbox Code Playgroud) 我正在寻找基于 Web 的工具来监控 Ubuntu 服务器(磁盘空间、内存等)
在 nagios 服务器上出现以下错误
root@VMb:/usr/local/nagios/libexec# ./check_nrpe -H 54.255.1.99 -n CHECK_NRPE:10 秒后套接字超时。
我不会不使用交换文件(由于内核或 AMD 驱动程序中的一些错误)。
我不想让一些 util 运行和监视可用系统内存并在它低于某个指定限制时提醒我。
这将通知我我需要关闭一些应用程序(或浏览器选项卡)以避免由于一些奇怪的 kswapd0 I/O 活动(可能是另一个错误)导致系统冻结。
有没有合适的软件?
更新:
我重新设计了 Gary 提供的脚本以满足我的需要并想分享它
#!/bin/bash
#Minimum available memory limit, MB
THRESHOLD=400
#Check time interval, sec
INTERVAL=30
while :
do
free=$(free -m|awk '/^Mem:/{print $4}')
buffers=$(free -m|awk '/^Mem:/{print $6}')
cached=$(free -m|awk '/^Mem:/{print $7}')
available=$(free -m | awk '/^-\/+/{print $4}')
message="Free $free""MB"", buffers $buffers""MB"", cached $cached""MB"", available $available""MB"""
if [ $available -lt $THRESHOLD ]
then
notify-send "Memory is running out!" "$message"
fi
echo $message
sleep $INTERVAL
done
Run Code Online (Sandbox Code Playgroud) 尝试以简单的方式安装 bpytop。
pytop
Command 'pytop' not found, did you mean:
command 'bpytop' from snap bpytop (1.0.50)
Run Code Online (Sandbox Code Playgroud)
好的,让我们一起做:
snap install bpytop
bpytop 1.0.50 from James Tigert (kz6fittycent) installed
root@xxx:/home/xxx# bpytop
Bpytop exited with errorcode (1). See /root/snap/bpytop/186/.config/bpytop/error.log for mor information!
10/12/20 (14:30:13) | ERROR: Data collection thread failed with exception: [Errno 13] **Permission denied**: '/proc/diskstats'
...
10/12/20 (14:30:13) | WARNING: Exiting with errorcode (1). Runtime 0:00:03
Run Code Online (Sandbox Code Playgroud)
好,我懂了:
这种方式不允许 bpytop 访问“硬件”
任何意见?
猜猜我最好还是老样子:
github -> 进行安装
monitoring ×9
nagios3 ×2
11.10 ×1
command-line ×1
filesystem ×1
log ×1
monitor ×1
notification ×1
ram ×1