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
Getting new mail in /var/spool/mail/root after deleted host
Re: Getting new mail in /var/spool/mail/root after deleted h
Did you apply the changes after you deleted the host?
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
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
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.cfgRe: Getting new mail in /var/spool/mail/root after deleted h
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
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
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?
Are you sure it isn't the result of the mrtg cron job?
Re: Getting new mail in /var/spool/mail/root after deleted h
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
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
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
This will stop root from being notified of the output of this cron job
edit /etc/cron.d/mrtg and add the following to the end of the line
Code: Select all
> /dev/null 2>&1Re: Getting new mail in /var/spool/mail/root after deleted h
Thank you for helping me.
You can lock/close my case.
I will back to you if get any help regarding Nagios/Nagios XI.
Thanks and Regards
Somnath Pandey
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
Excellent glad it is resolved.
Locking
Locking