From c571cd207a1ec76a13a8476df741722ac4ca4638 Mon Sep 17 00:00:00 2001 From: Ankush Grover Date: Tue, 14 Jun 2011 14:10:35 +0200 Subject: [PATCH] Initial version --- plugins/other/ossec-agents | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 plugins/other/ossec-agents diff --git a/plugins/other/ossec-agents b/plugins/other/ossec-agents new file mode 100755 index 00000000..6c5c2fb8 --- /dev/null +++ b/plugins/other/ossec-agents @@ -0,0 +1,31 @@ +#!/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