Hi
@Jacek,
How do I make sure that after the restore from backup Nagios will not re-enable monitoring and notifications
How do I turn off notifications completely (not sending alone, also generating them, so in case we do some tests and turn notifications on it will not send a bunch of old mails that stacked up over some time)
I would recommend disabling checks and notifications globally in the main nagios configuration file
/usr/local/nagios/etc/nagios.cfg, set the following values to:
Code: Select all
enable_notifications=0
execute_service_checks=0
execute_host_checks=0
This will put Nagios Core into a 'sleep mode' ( see
Main Configuration File Options ).
Is there a way to redirect all notifications to one email address (debug/test purpose) by modifying some script/settings?
Probably the best way to do this would be to change the notification handler Nagios uses to send emails to contacts. In the command string there is a macro that will reference the email address of the contacts associated with the host or service.
You can swap this macro with your own that points to the test email address instead of using the contact's email. For example, here is the host notification command for Nagios XI users:
Code: Select all
/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=host --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --type=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTHOR$" --comments="$NOTIFICATIONCOMMENT$" --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hostalias="$HOSTALIAS$" --hostdisplayname="$HOSTDISPLAYNAME$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --lasthoststate=$LASTHOSTSTATE$ --lasthoststateid=$LASTHOSTSTATEID$ --hoststatetype=$HOSTSTATETYPE$ --currentattempt=$HOSTATTEMPT$ --maxattempts=$MAXHOSTATTEMPTS$ --hosteventid=$HOSTEVENTID$ --hostproblemid=$HOSTPROBLEMID$ --hostoutput="$HOSTOUTPUT$" --longhostoutput="$LONGHOSTOUTPUT$" --datetime="$LONGDATETIME$" --number="$HOSTNOTIFICATIONNUMBER$"
and then change $CONTACTEMAIl$ to a new user defined macro with the test email address. You can make changes to commands in Nagios XI by going to Configure > CCM > Commands.
commands.png
Please see the following guides for more information:
Understanding the User Macro Component
Configuring Core Contacts to Use Nagios XI PHPMailer SMTP Settings (for information about notification handlers)
For your reference, below is a link to our guide for backing up and restoring Nagios XI.
Backing Up And Restoring Your Nagios XI System
Also, you can use a separate XI to server to
monitor your production system and notify you in the event the system stops running or becomes unreachable.
You do not have the required permissions to view the files attached to this post.