iwatch不给我发电子邮件或似乎做任何事情?

– 编辑 – 我没有安装opsview的运气,我试过nagios。 我正在使用nagios而且看起来不错。

我安装了iwatch并使sendmail工作(cron作业通过电子邮件发送给我)。 我为iwatch启用了deamon模式,并重新启动了iwatch。 我看到deamon和ps aux一起运行。

当我更改/ var / www / mysite中的一个文件时,我没有收到任何邮件,也没有看到任何事情发生。 我检查了使用mail cmd万一它去那里。 我没有添加目录(它的recursion,但我修改的文件不在一个子目录),并修改后重新启动守护进程。

我如何让iwatch观看并给我发电子邮件?


iwatch.xml。 **在我添加的行附近

 <config> <guard email="root@localhost" name="IWatch"/> <watchlist> <title>Operating System</title> <contactpoint email="root@localhost" name="Administrator"/> <path type="single" syslog="on">/bin</path> <path type="single" syslog="on">/sbin</path> <path type="single">/etc</path> <path type="recursive">/lib</path> <path type="exception">/lib/modules</path> **<path type="recursive">/var/www/fmyapp</path>** </watchlist> </config> 

在/ etc /默认/ IWATCH

 ## iwatch configuration file # START_DAEMON: # should iwatch start the iwatch daemon during boot? START_DAEMON=**true** (from false) # CONFIG_FILE: # configuration file for iwatch daemon # CONFIG_FILE=/etc/iwatch/iwatch.xml 

我没有改变任何东西从默认或添加一个cronjob或任何东西

在Ubuntu 12.04中, /etc/default/iwatch有一个错误,iwatch实际查找的variables是CONFIGFILE而不是CONFIG_FILE因此将它指向您的customeconfiguration

 CONFIGFILE=/etc/iwatch/iwatch.xml 

首先,如果您不想通过电子邮件发送本地系统,请更改:

<contactpoint email="root@localhost" name="Administrator"/>

<contactpoint email="[email protected]" name="Administrator"/>

如果你确定,那么下一步是检查它是否正在运行

ps aux | grep iwatch

然后用service命令启动它,即

service iwatch start

检查它是否再次运行

ps aux | grep iwatch

现在通过运行来testing它

touch /etc/test

你应该收到一封电子邮件,祝你好运!

这是configuration文件的一个很好的例子

https://github.com/kiwiroy/iwatch/blob/master/iwatch.xml.example