2012R1.0 - Occasional duplicate notification...???

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: 2012R1.0 - Occasional duplicate notification...???

Post by scottwilkerson »

I have a feeling this could be caused by duplicate versions of a cronjob running in parrallel

Can you run the following

Code: Select all

ps -ef |grep eventman
Not sure if we can catch it happening, but worth a try...
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
scobi
Posts: 67
Joined: Tue Feb 28, 2012 8:36 pm

Re: 2012R1.0 - Occasional duplicate notification...???

Post by scobi »

Code: Select all

# ps -ef |grep eventman                                  
nagios   28838 28820  0 17:58 ?        00:00:00 /bin/sh -c /usr/bin/php -q /usr/local/nagiosxi/cron/eventman.php > /usr/local/nagiosxi/var/eventman.log 2>&1    
nagios   28841 28828  0 17:58 ?        00:00:00 /bin/sh -c /usr/bin/php -q /usr/local/nagiosxi/cron/eventman.php > /usr/local/nagiosxi/var/eventman.log 2>&1    
nagios   28853 28838  0 17:58 ?        00:00:00 /usr/bin/php -q /usr/local/nagiosxi/cron/eventman.php                                                           
nagios   28856 28841  0 17:58 ?        00:00:00 /usr/bin/php -q /usr/local/nagiosxi/cron/eventman.php                                                           
root     29173 29128  0 17:58 pts/4    00:00:00 grep eventman
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: 2012R1.0 - Occasional duplicate notification...???

Post by scottwilkerson »

That is what I thought...

Can you post the following to see if we can track down why there are 2 of them running

Code: Select all

cat /etc/cron.d/nagiosxi
crontab -u nagios -l
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
scobi
Posts: 67
Joined: Tue Feb 28, 2012 8:36 pm

Re: 2012R1.0 - Occasional duplicate notification...???

Post by scobi »

Nice work Sherlock! :-)

Code: Select all

cat /etc/cron.d/nagiosxi

# /etc/cron.d/nagiosxi: crontab fragment for nagiosxi                           
                                                                                
# Backup MySQL & PostgreSQL Databases                                           
0   7 * * * root   /root/scripts/automysqlbackup                                
0   8 * * * root   /root/scripts/autopostgresqlbackup                           
                                                                                
*   * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/sysstat.php > /usr/local/nagiosxi/var/sysstat.log 2>&1                                              
*   * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/cmdsubsys.php > /usr/local/nagiosxi/var/cmdsubsys.log 2>&1                                          
*   * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/eventman.php > /usr/local/nagiosxi/var/eventman.log 2>&1                                            
*   * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/feedproc.php > /usr/local/nagiosxi/var/feedproc.log 2>&1                                            
*   * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/perfdataproc.php > /usr/local/nagiosxi/var/perfdataproc.log 2>&1                                    
*   * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/nom.php > /usr/local/nagiosxi/var/nom.log 2>&1                                                      
*   * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/reportengine.php > /usr/local/nagiosxi/var/reportengine.log 2>&1                                    
*/5 * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/dbmaint.php > /usr/local/nagiosxi/var/dbmaint.log 2>&1                                              
*   * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/cleaner.php > /usr/local/nagiosxi/var/cleaner.log 2>&1                                              
01  * * * * nagios /usr/local/nagiosxi/cron/recurringdowntime.pl > /usr/local/nagiosxi/var/recurringdowntime.log 2>&1                                           
*/5 * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/deadpool.php > /usr/local/nagiosxi/var/deadpool.log 2>&1 

                                           

crontab -u nagios -l                                   
* * * * * /usr/bin/php -q /usr/local/nagiosxi/cron/sysstat.php > /usr/local/nagiosxi/var/sysstat.log 2>&1                                                       
* * * * * /usr/bin/php -q /usr/local/nagiosxi/cron/cmdsubsys.php > /usr/local/nagiosxi/var/cmdsubsys.log 2>&1                                                   
* * * * * /usr/bin/php -q /usr/local/nagiosxi/cron/eventman.php > /usr/local/nagiosxi/var/eventman.log 2>&1                                                     
* * * * * /usr/bin/php -q /usr/local/nagiosxi/cron/feedproc.php > /usr/local/nagiosxi/var/feedproc.log 2>&1                                                     
* * * * * /usr/bin/php -q /usr/local/nagiosxi/cron/perfdataproc.php > /usr/local/nagiosxi/var/perfdataproc.log 2>&1                                             
* * * * * /usr/bin/php -q /usr/local/nagiosxi/cron/nom.php > /usr/local/nagiosxi/var/nom.log 2>&1                                                               
* * * * * /usr/bin/php -q /usr/local/nagiosxi/cron/reportengine.php > /usr/local/nagiosxi/var/reportengine.log 2>&1                                             
*/5 * * * * /usr/bin/php -q /usr/local/nagiosxi/cron/dbmaint.php > /usr/local/nagiosxi/var/dbmaint.log 2>&1                                                     
* * * * * /usr/bin/php -q /usr/local/nagiosxi/cron/cleaner.php > /usr/local/nagiosxi/var/cleaner.log 2>&1                                                       
01  * * * * /usr/local/nagiosxi/cron/recurringdowntime.pl > /usr/local/nagiosxi/var/recurringdowntime.log 2>&1                                                  
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: 2012R1.0 - Occasional duplicate notification...???

Post by scottwilkerson »

We have fixed this in the upgrade script, but to eliminate your problem I would remove the items from the nagios user crontab and keep the /etc/cron.d/nagiosxi file as this is what the system will expect.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
scobi
Posts: 67
Joined: Tue Feb 28, 2012 8:36 pm

Re: 2012R1.0 - Occasional duplicate notification...???

Post by scobi »

Excellent! Minor issue but glad you found it!

Can I get a little more detail on what I need to do, which file and which lines to remove? I'm still Linux n00b (but with your help I'm getting better!)...

Thanks!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: 2012R1.0 - Occasional duplicate notification...???

Post by scottwilkerson »

Sorry, you can run

Code: Select all

crontab -l -u nagios | grep -v /usr/local/nagiosxi/cron | crontab -u nagios -
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
scobi
Posts: 67
Joined: Tue Feb 28, 2012 8:36 pm

Re: 2012R1.0 - Occasional duplicate notification...???

Post by scobi »

Thanks Scott, I appreciate the hand holding and expertise!

:-)
Locked