Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_radius.pl

Rating
2 votes
Favoured:
0
Hits
172213
Files:
FileDescription
check_radius.plcheck_radius.pl
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
Plugin written in Perl using radclient and Status-Server packet from FreeRADIUS project. Performance data about elapsed time executing the query.
Reviews (2)
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");
}
byDoornenbal, May 17, 2011
1 of 1 people found this review helpful
It is just a pity the script doesn't check the availability of radclient. Was first mistaken with that! So check your requirements!