32 lines
666 B
Plaintext
32 lines
666 B
Plaintext
|
#!/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 Ossec"
|
||
|
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
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
ACTIVE=`/var/ossec/bin/list_agents -c | grep -wv "** No agent available" | wc -l`
|
||
|
INACTIVE=`/var/ossec/bin/list_agents -n | grep -wv "** No agent available" | wc -l`
|
||
|
|
||
|
echo "active.value ${ACTIVE}"
|
||
|
echo "inactive.value ${INACTIVE}"
|
||
|
exit 0
|