how to clear pending Notification

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
zaji_nms
Posts: 616
Joined: Tue Oct 16, 2012 12:28 am

how to clear pending Notification

Post by zaji_nms »

Dear Expert

Wishing you all HAPPY NEW YEAR and all the best during these days.

Nagios Server was up and running however some reachability issue occurred (assume main Gateway Router/Switch) was down.

Now when Nagios came UP its started sending old accumulated pending Notification in bulk, how to clear those from Nagios server?

Regards
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: how to clear pending Notification

Post by tgriep »

If you login to the XI interface and go to the Admin > Email Settings menu and is the Mail Method is set to Sendmail, you would run the following as root to clear the message queue.

Code: Select all

postsuper -d ALL

You will also, have to run the following in a root shell to stop, truncate old data and start the processes.

Code: Select all

service npcd stop
service nagios stop
service ndo2db stop
service crond stop
pkill -9 -u nagios
Depending if your server is hosting the nagiosxi database in MYSQL, you would run this.

Code: Select all

echo "truncate table xi_events; truncate table xi_meta; truncate table xi_eventqueue;" | mysql -u root -pnagiosxi nagiosxi
If it is Postgress, run this

Code: Select all

echo "truncate table xi_events; truncate table xi_meta; truncate table xi_eventqueue;" | psql nagiosxi nagiosxi
FYI, you can run them both if you are unsure, just one of the commands will generate an error and that is normal.

Code: Select all

mysqlcheck -f -r -u root -pnagiosxi --all-databases --use-frm
if grep --quiet pgsql /usr/local/nagiosxi/html/config.inc.php; then service postgresql stop; fi;
service mysqld restart
rm -f /usr/local/nagios/var/rw/nagios.cmd
rm -f /usr/local/nagios/var/nagios.lock
rm -f /var/run/nagios.lock
rm -f /usr/local/nagios/var/ndo.sock
rm -f /usr/local/nagios/var/ndo2db.lock
rm -f /var/lib/mrtg/mrtg_l
rm -f /usr/local/nagiosxi/var/*.lock
rm -f /usr/local/nagiosxi/tmp/*.lock
for i in `ipcs -q | grep nagios |awk '{print $2}'`; do ipcrm -q $i; done
pkill python
if grep --quiet pgsql /usr/local/nagiosxi/html/config.inc.php; then service postgresql start; fi;
service httpd restart
service ndo2db start
service nagios start
service npcd start
service crond start
All of the old pending Notifications should be gone now.
Be sure to check out our Knowledgebase for helpful articles and solutions!
zaji_nms
Posts: 616
Joined: Tue Oct 16, 2012 12:28 am

Re: how to clear pending Notification

Post by zaji_nms »

Thanks tgriep for detail reply,

NagiosXI having Feature to Enable/Disable NOTIFICATIONS, same way ...

i suggest to have WEB Feature to truncate/delete all pending Email/Notifications, easy and safe.

should have Feature Request....as we want better NagiosXI in future.

Regards
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: how to clear pending Notification

Post by tgriep »

That is a good idea to add the ability to remove queued up notifications in the web interface.
I can submit a feature request on your behalf if you'd like. Please keep in mind that the decision to implement the enhancement is at the sole discretion of our development team.
Be sure to check out our Knowledgebase for helpful articles and solutions!
zaji_nms
Posts: 616
Joined: Tue Oct 16, 2012 12:28 am

Re: how to clear pending Notification

Post by zaji_nms »

Yes tgriep

Please submit new Feature Request

everything should be on fingertip (here away only one/two mouse click)

regards
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: how to clear pending Notification

Post by tgriep »

A Feature Request has been put in for this.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked