radius

Author Eric Meddaugh
Compatibility Xymon 4.2
Requirements unix, Linux
Download None
Last Update 2006-11-26

Monitor Radius server.

  1. Add script to server's ext folder
  2. Add the following to the server hobbitlaunch.cfg
[radius]
	ENVFILE /home/hobbit/server/etc/hobbitserver.cfg
	NEEDS hobbitd
	CMD  $BBHOME/ext/radius.sh
	LOGFILE $BBSERVERLOGS/radius.log
	INTERVAL 1m

radius.sh

Show Code ⇲

Hide Code ⇱

#!/bin/sh

#
#
# This required the radclient utility:
#
# http://www.freeradius.org
#

## Add to the hobbitserver.cfg in the TEST2RRD section: radius=tcp, this will show a graph of respond time.
## Built on Solaris 10.

COLUMN=radius
### Radius User here
RADIUSUSER=<USERNAME>
### Radius Password here
RADIUSPASS=<passwd>
### Radius shared password here
RADIUSSECRET=<shared passwd>
TIMEOUT=10

$BBHOME/bin/bbhostgrep --no-down ${COLUMN} |
while read L
do
     set $L
     IP="$1"
     HOSTNAME="$2"
     COLOR=green

     /bin/ptime /usr/local/bin/radclient -t $TIMEOUT $IP auth $RADIUSSECRET >$BBTMP/${COLUMN}.out 2>&1 <<EOF
User-Name = $RADIUSUSER
User-Password = $RADIUSPASS
EOF
     SECONDS=`egrep "^real" $BBTMP/${COLUMN}.out | awk '{printf $2}'`

     if test $? -ne 0
     then
        COLOR=red
	MSG="Radius query failed

`cat $BBTMP/${COLUMN}.out`

Seconds: ${SECONDS}
"
     else
        COLOR=green
	MSG="Radius query succeeded

`cat $BBTMP/${COLUMN}.out`

Seconds: ${SECONDS}
"
  fi

  $BB $BBDISP "status $HOSTNAME.$COLUMN $COLOR `date`

  $MSG"
  $RM $BBTMP/${COLUMN}.out
done

exit 0
  • No known bugs
  • 2006-11-26
    • Initial release
  • monitors/radius.txt
  • Last modified: 2009/11/23 06:08
  • (external edit)