Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- cd /usr/local/nagios/etc/objects/services/
- NEWSERVICE=$(ls *.conf | sort -h | tail -n 1 | cut -f1 -d".")
- while read MONITOR OBJ SEVERITY
- do
- (( NEWSERVICE++ ))
- cat <<EOF> ${NEWSERVICE}.conf
- define service{
- host_name mysql
- service description ${NEWSERVICE}
- check_command check_dummy!${SEVERITY}!"$MONITOR $OBJ"
- active_checks_enabled 0
- passive_checks_enabled 1
- check_freshness 1
- freshness_threshold 4000
- }
- EOF
- done
- systemctl reload nagios
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement