mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-24 09:57:09 +00:00
update the ossec plugin
- harmonize the coding style of the three scripts - harmonize the label names and file names with other popular plugins - fix active_response script to use correct date format
This commit is contained in:
parent
375621b4ba
commit
c098ee86fa
6 changed files with 126 additions and 156 deletions
32
plugins/ossec/ossec_agents
Executable file
32
plugins/ossec/ossec_agents
Executable file
|
@ -0,0 +1,32 @@
|
|||
#!/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
|
||||
|
||||
### 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
|
Loading…
Add table
Add a link
Reference in a new issue