1 | 1 | simandl | #!/bin/bash |
2 | | | # chkconfig: 12345 55 45 |
3 | | | # description: System statistics |
4 | | | |
5 | | | cd "/opt/HotSaNIC" |
6 | | | |
7 | | | . ./settings |
8 | | | |
9 | | | case $1 in |
10 | | | start) |
11 | | | echo "Starting rrdtimer..." |
12 | | | ./rrdtimer.pl Dp |
13 | | | ;; |
14 | | | stop) |
15 | | | echo "Stopping rrdtimer..." |
16 | | | if [ -e "$PIDFILE" ]; then |
17 | | | PID=`cat "$PIDFILE"` |
18 | | | for nn in $PID ; do kill $nn; done |
19 | | | else |
20 | | | echo "pid-file not found, rrdtimer not running?!" |
21 | | | fi |
22 | | | ./clearall CLEAR_COUNTERS |
23 | | | ;; |
24 | | | status) |
25 | | | if [ -e $PIDFILE ]; then |
26 | | | echo "main process on PID `cat $PIDFILE` (according to PID-file)" |
27 | | | else |
28 | | | echo "pid-file not found, rrdtimer not running?!" |
29 | | | fi |
30 | | | ;; |
31 | | | restart) |
32 | | | ./rrdgraph stop |
33 | | | ./rrdgraph start |
34 | | | ;; |
35 | | | *) |
36 | | | echo "usage: rrdgraph [start|stop|status|restart]" |
37 | | | ;; |
38 | | | esac |