<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>check_radius</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=2 FACE="Arial">Hi All,</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">This is my first post so my appologies if I state anything stupid.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I wrote the following script and placed it into libexec.<BR>
</FONT>
<BR><FONT SIZE=2 FACE="Arial">#!/bin/bash</FONT>
<BR><FONT SIZE=2 FACE="Arial">PREFIX=/usr/bin</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">set `$PREFIX/radpwtst -trace 4 $USER1$/check_radius -s $1 -secret $2 -noacct -auth_port $3 -user $4 -password $5 -called_station_id $6 | tail -1`</FONT></P>
<P><FONT SIZE=2 FACE="Arial">if [ $1 = OK ] ; then</FONT>
<BR><FONT SIZE=2 FACE="Arial"> echo "OK"</FONT>
<BR><FONT SIZE=2 FACE="Arial">else</FONT>
<BR><FONT SIZE=2 FACE="Arial"> echo "CRITICAL - No reply"</FONT>
<BR><FONT SIZE=2 FACE="Arial">fi</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Basically it sends a RADIUS authentication request to a radius server and will either come back with OK or No reply... I have tested the script and it works perfectly, but when I Integrate it with nagios, like this:</FONT></P>
<P><FONT SIZE=2 FACE="Arial">define service{</FONT>
<BR><FONT SIZE=2 FACE="Arial"> use generic-service ; Name of service template to use</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial"> host_name x.x.x.x</FONT>
<BR><FONT SIZE=2 FACE="Arial"> service_description RADIUS </FONT>
<BR><FONT SIZE=2 FACE="Arial"> is_volatile 0 </FONT>
<BR><FONT SIZE=2 FACE="Arial"> check_period 24x7</FONT>
<BR><FONT SIZE=2 FACE="Arial"> max_check_attempts 3 </FONT>
<BR><FONT SIZE=2 FACE="Arial"> normal_check_interval 3 </FONT>
<BR><FONT SIZE=2 FACE="Arial"> retry_check_interval 1</FONT>
<BR><FONT SIZE=2 FACE="Arial"> contact_groups admins</FONT>
<BR><FONT SIZE=2 FACE="Arial"> notification_interval 120</FONT>
<BR><FONT SIZE=2 FACE="Arial"> notification_period 24x7</FONT>
<BR><FONT SIZE=2 FACE="Arial"> notification_options u,c,r </FONT>
<BR><FONT SIZE=2 FACE="Arial"> check_command check_radius!mysecret!1645!username!password!0198xxxxxx</FONT>
<BR><FONT SIZE=2 FACE="Arial"> } </FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">My web interface in nagios shows a green light and says that everything is ok... even when the response is CRITICAL...</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">How do I make nagios alarm when the script returns a CRITICAL error?</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Thanks in advance for any help you may offer.</FONT>
</P>
<BR>
<P><FONT FACE="Times New Roman">Rabbie Zalaf<BR>
Network Consultant<BR>
Leading Edge Internet<BR>
02 9497 4024<BR>
<U></U></FONT><A HREF="http://www.leadingedgeinternet.net.au"><U></U><U></U><U><FONT COLOR="#0000FF" FACE="Times New Roman">http://www.leadingedgeinternet.net.au</FONT></U><U></U></A><U></U><U></U>
<BR><FONT SIZE=2 FACE="Arial">-----BEGIN GEEK CODE BLOCK-----<BR>
VERSION: 3.1<BR>
GIT d++ s:>s-:- a22 C++++ L U+++<BR>
P+ L+++>$L+++++ E--- W+++ w-- M--<BR>
t+++ G++<BR>
-----END GEEK CODE BLOCK-----</FONT>
<BR><FONT FACE="Times New Roman">This document together with any attachments is confidential and is intended for the named recipient only. It can not be copied, disclosed, passed on or duplicated in any way shape or form, without the prior permission of the author. If you are not the intended recipient please contact the author immediately and destroy the message. All parties acknowledge that any breach of confidence or disclosures made by any party, (including their employees, agents and contracted service providers such as solicitors, accountants, auditors and others), which may result in a commercial loss to Leading Edge Group, may result in Leading Edge Group exercising such rights as are available to them in connection with that loss.</FONT></P>
<BR>
</BODY>
</HTML>