]>
Commit | Line | Data |
---|---|---|
7f553a10 ER |
1 | #!/bin/sh |
2 | # vim:ft=sh | |
3 | # enable for debugging: | |
4 | set -x | |
5 | exec 2>>/tmp/nagios-cacti.log | |
6 | #exec 1>&2 | |
7 | ||
8 | url="$1" | |
9 | type="$2" | |
10 | user="$3" | |
11 | password="$4" | |
12 | ||
13 | # Remove trailing slash if needed | |
14 | url="${url%/}" | |
15 | ||
16 | # pass user and password conditionally. | |
17 | # this way we can even have passwords in them. | |
18 | # retry only once with timeout of 30s | |
19 | wget -t 1 -T 30 --no-check-certificate -q -O- ${user:+--user="$user" --password="$password"} "$url/mrtgstats.cgi?type=$type" | |
20 | echo $? >&2 |