Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Directory
qha
byqha, May 2, 2012
Calling '/etc/init.d/radiusd restart' the first time I manage to supply all required options but hadn't configured my radius server well enough to permit the status-server request was rather excessive.
Also the plugin has a hard coded path to radclient that isn't where my distribution installed it.
I made some changes to make it easier to use, patchset pasted below, if you're responsible for this plugin and would like the patchset in a less likely to be mangled form please let me know!
---------------------- 80,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
@@ -33,22 +42,27 @@ print \$o_debug,
- 'H|hostname:s' => \$host,
- 'P|port:i' => \$port,
- 'w|warning:i' => \$w,
- 'c|critical:i' => \$c,
- 't|timeout:s' => \$t,
- 'e|exec:s' => \$exec,
- 's|secret:s' => \$secret,
-
+ 'h|help' => \$help,
+ 'd|debug' => \$debug,
+ 'H|hostname:s' => \$host,
+ 'P|port:i' => \$port,
+ 'w|warning:i' => \$w,
+ 'c|critical:i' => \$c,
+ 't|timeout:s' => \$t,
+ 'e|exec:s' => \$exec,
+ 'r|radclient:s' => \$radclient,
+ 's|secret:s' => \$secret,
+
);
- usage() if (defined($o_help));
- $debug = 1 if (defined($o_debug));
- if ( $port !~ /^\d+$/ or ($port 65535)) {
+ usage() if (defined($help));
+ if ( $port !~ /^\d+$/ or ($port 65535)) {
print "\nPlease insert an integer value between 1 and 65535\n";
usage();
}
@@ -90,7 +101,11 @@ sub check_options () {
if ( $t !~ /^\d+$/ or $t /dev/null 2>&1") != 0) {
+ print "\n$radclient used for radclient not found.\n";
+ usage();
+ }
if ( !defined($secret) ) {
print "\nPlease supply the secret for $host\n";
usage();
@@ -122,7 +137,7 @@ print " | ";
print "'Response Time'=$elapsed;$w;$c;0;$t\n";
if ( $? != 0 and defined($exec)) {
- print "DEBUG: radclient timeout: executing \"$exec\"\n";
+ print "DEBUG: radclient timeout: executing \"$exec\"\n" if $debug;
system("$exec 1>/dev/null 2>/dev/null");
}
Also the plugin has a hard coded path to radclient that isn't where my distribution installed it.
I made some changes to make it easier to use, patchset pasted below, if you're responsible for this plugin and would like the patchset in a less likely to be mangled form please let me know!
---------------------- 80,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
@@ -33,22 +42,27 @@ print \$o_debug,
- 'H|hostname:s' => \$host,
- 'P|port:i' => \$port,
- 'w|warning:i' => \$w,
- 'c|critical:i' => \$c,
- 't|timeout:s' => \$t,
- 'e|exec:s' => \$exec,
- 's|secret:s' => \$secret,
-
+ 'h|help' => \$help,
+ 'd|debug' => \$debug,
+ 'H|hostname:s' => \$host,
+ 'P|port:i' => \$port,
+ 'w|warning:i' => \$w,
+ 'c|critical:i' => \$c,
+ 't|timeout:s' => \$t,
+ 'e|exec:s' => \$exec,
+ 'r|radclient:s' => \$radclient,
+ 's|secret:s' => \$secret,
+
);
- usage() if (defined($o_help));
- $debug = 1 if (defined($o_debug));
- if ( $port !~ /^\d+$/ or ($port 65535)) {
+ usage() if (defined($help));
+ if ( $port !~ /^\d+$/ or ($port 65535)) {
print "\nPlease insert an integer value between 1 and 65535\n";
usage();
}
@@ -90,7 +101,11 @@ sub check_options () {
if ( $t !~ /^\d+$/ or $t /dev/null 2>&1") != 0) {
+ print "\n$radclient used for radclient not found.\n";
+ usage();
+ }
if ( !defined($secret) ) {
print "\nPlease supply the secret for $host\n";
usage();
@@ -122,7 +137,7 @@ print " | ";
print "'Response Time'=$elapsed;$w;$c;0;$t\n";
if ( $? != 0 and defined($exec)) {
- print "DEBUG: radclient timeout: executing \"$exec\"\n";
+ print "DEBUG: radclient timeout: executing \"$exec\"\n" if $debug;
system("$exec 1>/dev/null 2>/dev/null");
}