2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00
contrib-munin/plugins/ossec/ossec_agents
dipohl ed77c82d8a Category Tree: Reduce number of categories
multiple plugins -> "mail" (qsmtpd, zimbra)
ossec -> "security" (ossec)
zeo -> appserver (zope)
2017-02-22 23:20:56 +01:00

33 lines
791 B
Bash
Executable File

#!/bin/bash
if [ "$1" = "autoconf" ]; then
echo "yes"
exit 0
fi
if [ "$1" = "config" ]; then
echo "graph_title Ossec agents status"
echo "graph_args --base 1000 -l 0"
echo "graph_vlabel Number of ossec agents"
echo "graph_category security"
echo "graph_scale no"
echo "active.label active"
echo "active.draw LINE2"
echo 'active.min 0'
echo "inactive.label inactive"
echo "inactive.draw LINE2"
echo 'inactive.min 0'
exit 0
fi
### where to find the ossec tools
ossecdir="/var/ossec/bin"
### count the lines from the output of the list_agents tool
ACTIVE=`$ossecdir/list_agents -c | grep -wv "** No agent available" | wc -l`
INACTIVE=`$ossecdir/list_agents -n | grep -wv "** No agent available" | wc -l`
echo "active.value ${ACTIVE}"
echo "inactive.value ${INACTIVE}"
exit 0