Monitor freeRadius

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Monitor freeRadius

Post by jkinning »

On my old Nagios core I was using this perl script to monitor UDP 1812 and UDP 1813 on our freeRadius servers.

Code: Select all

#!/usr/bin/perl

use strict;
use IO::Socket::INET;

my $host = $ARGV[0];
my $port = $ARGV[1];

my $sock = IO::Socket::INET->new(PeerAddr => $host,
                                 PeerPort => $port,
                                 Proto    => 'udp') || exit 1;
my $retry = 3;
my $count = 0;

while ($retry--) {
  unless (send($sock, "ping!", 0)) {
    $count++;
  }
  sleep(5);
}

if ($count == 0) {
  print "OK\n";
  exit 0;
} elsif ($count > 0) {
  print "CRITICAL - $count pings failed\n";
  exit 2;
}
I am trying to eliminate my perl scripts and use compiled checks as I hear they are more efficient. I cannot get the check_udp check to work and basically clueless at this point. :?:

./check_udp -H <host> -p 1812
With UDP checks, a send/expect string must be specified.
Usage:
check_udp -H host -p port [-w <warning time>] [-c <critical time>] [-s <send string>]
[-e <expect string>] [-q <quit string>][-m <maximum bytes>] [-d <delay>]
[-t <timeout seconds>] [-r <refuse state>] [-M <mismatch state>] [-v] [-4|-6] [-j]
[-D <warn days cert expire>[,<crit days cert expire>]] [-S <use SSL>] [-E]

What should I use for the send/expect string or is there a different check that I should be using?
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Monitor freeRadius

Post by tgriep »

We don't have a FreeRadius server to test this but I searched and found that someone tried this.
Send=%001D%000,0123456789012345%001%006TEST%002%018abcdefghijklmnop
Expect=.D%000
We also found another post that FreeRadius uses both TCP and UDP so you could try and telnet to those ports and see what you get for a response and try that.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked