Created
March 16, 2018 21:25
-
-
Save rakesh-patnaik/68e8c74b2d1e121668811f848b8c4daf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| now=$(date) | |
| NAGIOS_CONFIG_FOLDER="/usr/local/nagios/etc" | |
| files=`find $NAGIOS_CONFIG_FOLDER -type f -mmin -1` | |
| if [[ $files == "" ]] ; then | |
| echo "no change noticed in nagios config $now" | |
| else | |
| echo "Reloading nagios to load changed contents $NAGIOS_CONFIG_FOLDER at $now" | |
| config_test=$(/usr/local/nagios/bin/nagios -f $NAGIOS_CONFIG_FOLDER/nagios.cfg) | |
| if [ $? -eq 0 ] | |
| then | |
| service nagios reload | |
| fi | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment