Getting new mail in /var/spool/mail/root after deleted host

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
cssp
Posts: 21
Joined: Thu May 17, 2018 10:31 pm

Getting new mail in /var/spool/mail/root after deleted host

Post by cssp »

Dear Team,

I am new in both Linux and Nagios/Nagios XI. so please help me.

I configured Nagios XI in CenstOS 7 and its working fine. I added hosts(Window PC, Linux PC and Switch) for the testing purpose through and its added successfully. After that I tested for notification and alert and I got if any think goes down or critical in my mail.

Now I removed/deleted the host(Switch) from Nagios XI through Web console but receiving mail in /var/spool/mail/root every 5 minutes. Hence I show the mails in /var/spool/mail/root, Its showing all the status details about the switch port.

So, Please help me, how to stop all the getting mails if I removed the hosts in Nagios XI ?

Thanks
Somnath Pandey
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Getting new mail in /var/spool/mail/root after deleted h

Post by eloyd »

Did you apply the changes after you deleted the host?
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Getting new mail in /var/spool/mail/root after deleted h

Post by scottwilkerson »

Yes, make sure you applies the configuration after removing the host/services

If you have already done that lets run the following the verify you don't have multiple nagios parent processes

Code: Select all

ps -ef|grep nagios.cfg
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
cssp
Posts: 21
Joined: Thu May 17, 2018 10:31 pm

Re: Getting new mail in /var/spool/mail/root after deleted h

Post by cssp »

Thank you for reply,

Yes, I did apply configuration after deleted the Switch host.

I ran the command ps -ef | grep nagios.cfg

its showing

nagios 1963 1 0 13:20 ? 00:00:01 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 1963 1 0 13:20 ? 00:00:01 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
root 22345 2222 0 14:24 tty1 00:00:00 grep --color=auto nagios.cfg

Regards
Somnath Pandey
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Getting new mail in /var/spool/mail/root after deleted h

Post by scottwilkerson »

Can you give us an example of a portion of the message you are getting in /var/spool/mail/root

Are you sure it isn't the result of the mrtg cron job?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
cssp
Posts: 21
Joined: Thu May 17, 2018 10:31 pm

Re: Getting new mail in /var/spool/mail/root after deleted h

Post by cssp »

Please check the example of the mail receiving very 5 min.

Example:
X= Port number of switch from 1 to 26

2018-05-31 09:10:12: ERROR: Target[192.168.0.239_X][_IN_] ' $target->[X-1]{$mode} ' did not eval into defined data
2018-05-31 09:10:12: ERROR: Target[192.168.0.239_X][_OUT_] ' $target->[X-1]{$mode} ' did not eval into defined data

If connecting to LAN (it's mean 192.168.0.239 is able to ping from the Nagios System) then mails are not receiving.


Regards
Somnath Pandey
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Getting new mail in /var/spool/mail/root after deleted h

Post by scottwilkerson »

This is not a notification from nagios it is from MRTG.

edit /etc/cron.d/mrtg and add the following to the end of the line

Code: Select all

 > /dev/null 2>&1
This will stop root from being notified of the output of this cron job
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
cssp
Posts: 21
Joined: Thu May 17, 2018 10:31 pm

Re: Getting new mail in /var/spool/mail/root after deleted h

Post by cssp »

Thank you for helping me. :D

You can lock/close my case.

I will back to you if get any help regarding Nagios/Nagios XI.

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

Re: Getting new mail in /var/spool/mail/root after deleted h

Post by scottwilkerson »

Excellent glad it is resolved.

Locking
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked