/[rrd-simple-monitoring]/bin/snmp.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /bin/snmp.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (show annotations)
Thu Jul 16 18:48:19 2009 UTC (14 years, 9 months ago) by dpavlin
File MIME type: application/x-sh
File size: 838 byte(s)
import upstream http://rrd.me.uk/rrd-simple-monitoring.tar.gz

without prerequisities

1 #!/bin/bash
2
3 config_file="$1"
4
5 if test -z "$config_file"
6 then
7 echo "Syntax: snmp.sh <config>"
8 exit
9 fi
10
11 if ! test -e "$config_file"
12 then
13 echo "Warning: configuration file '$config_file' does not exist!"
14 exit
15 fi
16
17 if ! test -s "$config_file"
18 then
19 echo "Warning: configuration file '$config_file' is empty!"
20 exit
21 fi
22
23 egrep -v '^\s*[#;]' "$config_file" | while read host community version port
24 do
25 if test -z "$community"
26 then
27 community="public"
28 fi
29
30 if test -z "$version"
31 then
32 version="2c"
33 fi
34
35 if test -z "$port"
36 then
37 port="161"
38 fi
39
40 if test -n "$host"
41 then
42 temp="/tmp/snmp-$host-$port-$$"
43 echo "Probing '$host' [community=$community, version=$version, port=$port] ..."
44 rrd-client.pl -q -s "$host" -c "$community" -V "$version" -P "$port" > "$temp"
45 cat "$temp" | rrd-server.pl -u "$host"
46 rm -f "$temp"
47 fi
48 done
49

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26