Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
I'm new to Nagios, so I apologize if anything I'm asking seems silly.
I'm running Nagios Core (4.4.6) to monitor a homemade Ubuntu Linux router with a RAID 1 array. Nagios is running on that machine, so monitoring the localhost. I've successfully set up and received notifications for the status of the RAID array (using https://exchange.nagios.org/directory/P ... id/details) when I purposely set one of the partitions as faulty. I am now trying to set up a "daily update" alert for the RAID array to confirm that it is being checked and is healthy. The service check is set up separately from the previous RAID check (that will alert me anytime there is a problem), but using the same command script. Here's what I've done:
The notification handlers will only be called on hard state changes, so if the service stays in OK, then you would not receive a notification. There are quite a few options to keep a check on things. You can set up another instance to monitor the monitoring application or you can create a simple bash script that runs once a day and sends a custom notification.
#!/bin/sh
# This is a sample shell script showing how you can submit the SEND_CUSTOM_SVC_NOTIFICATION command
# to Nagios. Adjust variables to fit your environment as necessary.
now=`date +%s`
commandfile='/usr/local/nagios/var/rw/nagios.cmd'
/bin/printf "[%lu] SEND_CUSTOM_SVC_NOTIFICATION;envirosensor;Water Level;3;Ethan;The NOC is currently flooding. Help!\n" $now > $commandfile
Thank you! I'll follow up after trying this (I'm not able to get to that machine right now), but I don't see why it wouldn't work. I thought the hard state not changing may be the problem, but I had no idea how to get around it, and I wasn't able to find the solution you posted when searching.