Skip to content

Instantly share code, notes, and snippets.

@sawanoboly
Created April 12, 2012 02:10
Show Gist options
  • Save sawanoboly/2364272 to your computer and use it in GitHub Desktop.
Save sawanoboly/2364272 to your computer and use it in GitHub Desktop.
Munin Plugin. "Check Number of Nagios3."
#!/usr/bin/env bash
curl -f -s https://raw.github.com/gist/2364272/f9a2cfd9bad80455d30ba5c9250db2a4aab6c8ea/monitoring_processes.sh -o /usr/local/bin/monitoring_processes
chmod +x /usr/local/bin/monitoring_processes
ln -f -s /usr/local/bin/monitoring_processes /etc/munin/plugins/
service munin-node reload
#!/usr/bin/env bash
case $1 in
autoconf)
echo yes
exit
;;
config)
cat <<EOL
graph_title Number of Nagios3
graph_vlabel number of Nagios3
graph_category Monitoring_Processes
graph_info This graph shows the number of Nagios3 Processes.
procs.label procs
procs.draw LINE2
procs.info The current number of procs.
EOL
exit;
esac
VAL1=`/usr/lib/nagios/plugins/check_procs -Cnagios3 -p1 | cut -f3 -d' '`
echo procs.value $VAL1
@sawanoboly
Copy link
Author

./monitoring_processes autoconf

yes

./monitoring_processes.sh config

graph_title Number of Nagios3
graph_vlabel number of Nagios3
graph_category Monitoring_Processes
graph_info This graph shows the number of Nagios3 Processes.
procs.label procs
procs.draw LINE2
procs.info The current number of procs.

./monitoring_processes.sh

procs.value 10

@sawanoboly
Copy link
Author

@sawanoboly
Copy link
Author

telnet localhost 4949

fetch monitoring_processes
procs.value 54
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment