summaryrefslogtreecommitdiffstats
path: root/web/attachments/241808-configure.in_check_dig.c.diff
diff options
context:
space:
mode:
Diffstat (limited to 'web/attachments/241808-configure.in_check_dig.c.diff')
-rw-r--r--web/attachments/241808-configure.in_check_dig.c.diff126
1 files changed, 126 insertions, 0 deletions
diff --git a/web/attachments/241808-configure.in_check_dig.c.diff b/web/attachments/241808-configure.in_check_dig.c.diff
new file mode 100644
index 0000000..3ba9b50
--- /dev/null
+++ b/web/attachments/241808-configure.in_check_dig.c.diff
@@ -0,0 +1,126 @@
1diff -Nru configure.in.orig configure.in
2--- configure.in.orig 2007-07-28 17:40:54.000000000 +0000
3+++ configure.in 2007-07-28 13:38:11.000000000 +0000
4@@ -93,6 +93,7 @@
5 PKG_ARCH=`uname -p`
6 REV_DATESTAMP=`date '+%Y.%m.%d.%H.%M'`
7 REV_TIMESTAMP=`date '+%Y%m%d%H%M%S'`
8+first_ip=`/sbin/ifconfig | egrep "inet addr:" | sed -n '1p' | sed 's/ Bcast.*$//' | sed 's/^\s*inet addr://'`
9
10 AC_SUBST(PKG_ARCH)
11 AC_SUBST(REV_DATESTAMP)
12@@ -771,14 +772,14 @@
13 fi
14
15 elif [[ "z$ac_cv_uname_s" = "zUnixWare" ]] && \
16- $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
17+ $PATH_TO_PING -n -s $first_ip 56 1 2>/dev/null | \
18 egrep -i "^round-trip|^rtt" >/dev/null
19 then
20 with_ping_command="$PATH_TO_PING -n -U -c %d %s"
21 ac_cv_ping_packets_first=yes
22 AC_MSG_RESULT([$with_ping_command])
23
24-elif $PATH_TO_PING -n -U -w 10 -c 1 127.0.0.1 2>/dev/null | \
25+elif $PATH_TO_PING -n -U -w 10 -c 1 $first_ip 2>/dev/null | \
26 egrep -i "^round-trip|^rtt" >/dev/null
27 then
28 with_ping_command="$PATH_TO_PING -n -U -w %d -c %d %s"
29@@ -786,52 +787,52 @@
30 ac_cv_ping_has_timeout=yes
31 AC_MSG_RESULT([$with_ping_command])
32
33-elif $PATH_TO_PING -n -U -c 1 127.0.0.1 2>/dev/null | \
34+elif $PATH_TO_PING -n -U -c 1 $first_ip 2>/dev/null | \
35 egrep -i "^round-trip|^rtt" >/dev/null
36 then
37 with_ping_command="$PATH_TO_PING -n -U -c %d %s"
38 ac_cv_ping_packets_first=yes
39 AC_MSG_RESULT([$with_ping_command])
40
41-elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
42+elif $PATH_TO_PING -n -c 1 $first_ip 2>/dev/null | \
43 egrep -i "^round-trip|^rtt" >/dev/null
44 then
45 with_ping_command="$PATH_TO_PING -n -c %d %s"
46 ac_cv_ping_packets_first=yes
47 AC_MSG_RESULT([$with_ping_command])
48
49-elif $PATH_TO_PING -n 127.0.0.1 -c 1 2>/dev/null | \
50+elif $PATH_TO_PING -n $first_ip -c 1 2>/dev/null | \
51 egrep -i "^round-trip|^rtt" >/dev/null
52 then
53 with_ping_command="$PATH_TO_PING -n %s -c %d"
54 AC_MSG_RESULT([$with_ping_command])
55
56-elif $PATH_TO_PING 127.0.0.1 -n 1 2>/dev/null | \
57+elif $PATH_TO_PING $first_ip -n 1 2>/dev/null | \
58 egrep -i "^round-trip|^rtt" >/dev/null
59 then
60 with_ping_command="$PATH_TO_PING %s -n %d"
61 AC_MSG_RESULT([$with_ping_command])
62
63-elif $PATH_TO_PING -n -s 127.0.0.1 56 1 2>/dev/null | \
64+elif $PATH_TO_PING -n -s $first_ip 56 1 2>/dev/null | \
65 egrep -i "^round-trip|^rtt" >/dev/null
66 then
67 with_ping_command="$PATH_TO_PING -n -s %s 56 %d"
68 AC_MSG_RESULT([$with_ping_command])
69
70-elif $PATH_TO_PING -n -h 127.0.0.1 -s 56 -c 1 2>/dev/null | \
71+elif $PATH_TO_PING -n -h $first_ip -s 56 -c 1 2>/dev/null | \
72 egrep -i "^round-trip|^rtt" >/dev/null
73 then
74 with_ping_command="$PATH_TO_PING -n -h %s -s 56 -c %d"
75 AC_MSG_RESULT([$with_ping_command])
76
77-elif $PATH_TO_PING -n -s 56 -c 1 127.0.0.1 2>/dev/null | \
78+elif $PATH_TO_PING -n -s 56 -c 1 $first_ip 2>/dev/null | \
79 egrep -i "^round-trip|^rtt" >/dev/null
80 then
81 with_ping_command="$PATH_TO_PING -n -s 56 -c %d %s"
82 ac_cv_ping_packets_first=yes
83 AC_MSG_RESULT([$with_ping_command])
84
85-elif $PATH_TO_PING -n -c 1 127.0.0.1 2>/dev/null | \
86+elif $PATH_TO_PING -n -c 1 $first_ip 2>/dev/null | \
87 egrep -i "^round-trip|^rtt" >/dev/null
88 then
89 with_ping_command="$PATH_TO_PING -n -c %d %s"
90@@ -1034,7 +1035,7 @@
91 if test -n "$PATH_TO_NSLOOKUP"
92 then
93 AC_MSG_CHECKING(for nslookup syntax)
94- if $PATH_TO_NSLOOKUP -sil 127.0.0.1 2>&1 | grep ["Invalid option: sil"] >/dev/null
95+ if $PATH_TO_NSLOOKUP -sil $first_ip 2>&1 | grep ["Invalid option: sil"] >/dev/null
96 then
97 ac_cv_nslookup_command="$PATH_TO_NSLOOKUP"
98 AC_MSG_RESULT([$ac_cv_nslookup_command])
99diff -Nru plugins/check_dig.c.orig plugins/check_dig.c
100--- plugins/check_dig.c.orig 2007-07-29 20:59:04.000000000 +0200
101+++ plugins/check_dig.c 2007-07-29 20:53:15.000000000 +0200
102@@ -59,6 +59,7 @@
103 char *record_type = "A";
104 char *expected_address = NULL;
105 char *dns_server = NULL;
106+char server_name[256];
107 int verbose = FALSE;
108 int server_port = DEFAULT_PORT;
109 double warning_interval = UNDEFINED;
110@@ -277,8 +278,13 @@
111 dns_server = argv[c];
112 }
113 else {
114- dns_server = strdup ("127.0.0.1");
115- }
116+ if(gethostname(server_name, 255) != 0) {
117+ host_or_die("Can't get local hostname");
118+ }
119+ else {
120+ dns_server = strdup (server_name);
121+ }
122+ }
123 }
124
125 return validate_arguments ();
126