NRPE: Custom plugin
Posted: Tue May 08, 2018 5:45 am
Hello!
I had make own custom plugin on Bash that checks *.txt file to control quantity of messages in DB.
Here it is:
The result is:
https://prnt.sc/jf7u7p
In Nagios it works fine except graphic data. What I have to do to draw graphics?
http://prntscr.com/jf7usc
P.S. I use Nagios XI 5.4.11
I had make own custom plugin on Bash that checks *.txt file to control quantity of messages in DB.
Here it is:
Code: Select all
#!/bin/bash
msgs=`cat msgs_stats.txt | tail -1 | awk '{print $5}'`
case $msgs in
[1000-99999999999999999999999999999999999999]*)
echo "OK - $msgs messages in DB"
exit 0
;;
[1-999]*)
echo "WARNING - $msgs messages in DB"
exit 1
;;
[0]*)
echo "CRITICAL - $msgs messages in DB"
exit 2
;;
*)
echo "UNKNOWN - $msgs messages in DB"
exit 3
;;
esacThe result is:
Code: Select all
# ./check_msg_stats.sh
OK - 1609677783 messages in DBIn Nagios it works fine except graphic data. What I have to do to draw graphics?
http://prntscr.com/jf7usc
P.S. I use Nagios XI 5.4.11