So I noticed today that my commands stop working every once in a while and I have to restart nagios or apply config to get them working again. I just tried to enable notifications(had them disabled for a major outage) and it wrote the command to the file, but it never processed. I had to apply config, wait and then try again.
prw-rw---- 1 nagios nagcmd 0 May 14 01:55 nagios.cmd
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
As for all your other questions:
1.)if I stop the process, it does vanish
2.)It never reappears until the process is started back up(only waited a few minutes, can't wait too long)
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Do you have any other checks, event handlers, cron jobs, or anything that would be writing to the command file?
Just so we know which file your SNMPTT is using, please post the output of one of your /etc/snmp/snmptt.conf EXEC lines from one of your working traps and the contents of your /etc/snmp/snmptrapd.conf file.
Yes, I have a custom component that writes to the nagios.cmd file. Its for entering downtimes as it adds the options for entering servicegroup and hostgroup ones and allows me to set some defaults to help eliminate human errors when creating downtime.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
$fh = fopen('/usr/local/nagios/var/rw/nagios.cmd', "a") or die(gettext("Error: Could not open downtime config file for writing."));
fwrite($fh, $cfg_str);
fclose($fh);
So I need to follow your lead and verify its fifo and if not wait a few and try again for a few times and then fail if still not?
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Cool, thanks for the information, I'll make the code change now....feel free to close this thread!
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github