2015-02-04 17:24:37 +01:00
|
|
|
#!/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"
|
2017-02-22 23:20:56 +01:00
|
|
|
echo "graph_category security"
|
2015-02-04 17:24:37 +01:00
|
|
|
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
|