jablonka.czprosek.czf

crusader

Subversion Repositories:
[/] [trunk/] [statistiky/] [opt/] [statistiky/] [monitor_zebra/] [monitor_zebra] - Blame information for rev 1

 

Line No. Rev Author Line
11simandl#!/bin/bash
2 
3logfile=/var/log/Heaven/zebra.mon
4#chmod +r $logfile
5 
6zebraline=`ps ax | grep sbin/zebra | grep -v grep`
7if [ ! -z "$zebraline" ] ; then
8 zebrapid=`echo $zebraline | awk '{print $1;}'`
9else
10 zebrapid="not running"
11fi
12ospfline=`ps ax | grep sbin/ospfd | grep -v grep`
13if [ ! -z "$ospfline" ] ; then
14 ospfpid=`echo $ospfline | awk '{print $1;}'`
15else
16 ospfpid="not running"
17fi
18routes=`route -n | grep wlan[01] | wc -l`
19routes=`expr $routes + 0`
20 
21now=`date +"%Y-%m-%d %H:%M:%S"`
22unixtime=`date +"%s"`
23echo "$now $unixtime zebra: $zebrapid ospf: $ospfpid routes: $routes" >>$logfile
24 
25if [ -f /var/statistiky/zebra.rrd ] ; then
26 /opt/rrdtool/bin/rrdtool update /var/statistiky/zebra.rrd $unixtime:$routes
27fi

Powered by WebSVN 2.2.1