forwarded 721621 https://github.com/monitoring-plugins/monitoring-plugins/issues/1231 tags 721621 + upstream thanks
Hi Daniel, Am 02.02.2014 12:25, schrieb Daniel Pocock: > On 02/02/14 12:09, Jan Wagner wrote: >> I discovered that this is not a drop-in replacement and thus >> nagios-plugins-standard has unfortunately no check_radius shipped. As >> upstream is not supporting this right now, this has to be implemented >> first to switch over to libfreeradius-client2. >> >> To fix this for now, I'm falling back to libradiusclient-ng2 until we >> get support for libfreeradius-client2. >> > > libradiusclient-ng2 may well be orphaned and removed from jessie > > Please have a look at the patch we applied on the Asterisk package to > use freeradius-client, it is very trivial I applied the attached patch to the upstream source. Unfortunately it does not compile clean when building against libfreeradius-client2: i486-linux-gnu-gcc -DLOCALEDIR=\"/usr/share/locale\" -DHAVE_CONFIG_H -I. -I.. -I.. -I../lib -I../gl -I../intl -I/usr/include/ldap -I/usr/include/postgresql -I/usr/include -DNP_VERSION='"1.5"' -Wall -g -O2 -MT check_radius.o -MD -MP -MF .deps/check_radius.Tpo -c -o check_radius.o check_radius.c check_radius.c: In function 'main': check_radius.c:148:2: error: unknown type name 'UINT4' UINT4 service; ^ check_radius.c:152:2: error: unknown type name 'UINT4' UINT4 client_id; ^ check_radius.c:196:2: warning: passing argument 6 of 'rc_buildreq' makes pointer from integer without a cast [enabled by default] my_rc_buildreq (&data, PW_ACCESS_REQUEST, server, port, (int)timeout_interval, ^ In file included from check_radius.c:43:0: /usr/include/freeradius-client.h:428:6: note: expected 'char *' but argument is of type 'int' void rc_buildreq(rc_handle *, SEND_DATA *, int, char *, unsigned short, char *, int, int); ^ check_radius.c:196:2: error: too few arguments to function 'rc_buildreq' my_rc_buildreq (&data, PW_ACCESS_REQUEST, server, port, (int)timeout_interval, ^ In file included from check_radius.c:43:0: /usr/include/freeradius-client.h:428:6: note: declared here void rc_buildreq(rc_handle *, SEND_DATA *, int, char *, unsigned short, char *, int, int); ^ As I'm not familiar with this radius specific part, this should be investigated deeper and I reported this bug upstream. Anyways, patches are welcome. Cheers, Jan. -- Never write mail to <w...@spamfalle.info>, you have been warned! -----BEGIN GEEK CODE BLOCK----- Version: 3.12 GIT d-- s+: a C+++ UL++++ P+ L+++ E--- W+++ N+++ o++ K++ w--- O M V- PS PE Y++ PGP++ t-- 5 X R tv- b+ DI D+ G++ e++ h---- r+++ y++++ ------END GEEK CODE BLOCK------
From ecc2eff610239c35a69f57e1b5dd516ec1d52973 Mon Sep 17 00:00:00 2001 From: Jan Wagner <w...@cyconet.org> Date: Sun, 2 Feb 2014 14:46:18 +0100 Subject: [PATCH] check_radius: adding FreeRADIUS client library This is a first attempt to add FreeRADIUS support. (Closes #1231) --- REQUIREMENTS | 12 ++++++++---- configure.in | 11 +++++++++-- plugins/check_radius.c | 25 ++++++++++++++----------- 3 files changed, 31 insertions(+), 17 deletions(-) diff --git a/REQUIREMENTS b/REQUIREMENTS index b2bd467..0b59d5f 100644 --- a/REQUIREMENTS +++ b/REQUIREMENTS @@ -50,14 +50,18 @@ check_dbi: http://libdbi.sourceforge.net/ check_radius: - - Requires the radiusclient-ng library available from: - http://developer.berlios.de/projects/radiusclient-ng/ + - Requires the freeradius-client library available from: + http://freeradius.org/freeradius-client/ + - This plugin also works with the radiusclient-ng library available + from: http://developer.berlios.de/projects/radiusclient-ng/ + Unfortunately this software package is unmaintained since many years. - This plugin also works with the original radiusclient library from ftp://ftp.cityline.net/pub/radiusclient/ RPM (rpmfind): radiusclient 0.3.2, radiusclient-devel-0.3.2 Unless you're using a distro-maintained version of this library you - probably want to use radiusclient-ng. The original radiusclient library is - unmaintained and has many known issues, particularly with 64bit systems. + probably want to use freeradius-client. The original radiusclient + library is unmaintained and has many known issues, particularly with + 64bit systems. check_snmp: - Requires the NET-SNMP package available from diff --git a/configure.in b/configure.in index 401bc63..f54b811 100644 --- a/configure.in +++ b/configure.in @@ -286,8 +286,15 @@ AS_IF([test "x$with_radius" != "xno"], [ RADIUSLIBS="-lradiusclient-ng" AC_SUBST(RADIUSLIBS) else - AC_MSG_WARN([Skipping radius plugin]) - AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).]) + AC_CHECK_LIB(freeradius-client,rc_read_config) + if test "$ac_cv_lib_freeradius_client_rc_read_config" = "yes"; then + EXTRAS="$EXTRAS check_radius" + RADIUSLIBS="-lfreeradius-client" + AC_SUBST(RADIUSLIBS) + else + AC_MSG_WARN([Skipping radius plugin]) + AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).]) + fi fi fi LIBS="$_SAVEDLIBS" diff --git a/plugins/check_radius.c b/plugins/check_radius.c index 3481f0c..c026bcc 100644 --- a/plugins/check_radius.c +++ b/plugins/check_radius.c @@ -39,6 +39,9 @@ #ifdef HAVE_LIBRADIUSCLIENT_NG #include <radiusclient-ng.h> rc_handle *rch = NULL; +#elif HAVE_LIBFREERADIUS_CLIENT +#include <freeradius-client.h> +rc_handle *rch = NULL; #else #include <radiusclient.h> #endif @@ -48,20 +51,20 @@ void print_usage (void); /* libradiusclient(-ng) wrapper functions */ -#ifdef HAVE_LIBRADIUSCLIENT_NG -#define my_rc_conf_str(a) rc_conf_str(rch,a) -#define my_rc_send_server(a,b) rc_send_server(rch,a,b) -#define my_rc_buildreq(a,b,c,d,e,f) rc_buildreq(rch,a,b,c,d,e,f) -#define my_rc_own_ipaddress() rc_own_ipaddress(rch) -#define my_rc_avpair_add(a,b,c,d) rc_avpair_add(rch,a,b,c,-1,d) -#define my_rc_read_dictionary(a) rc_read_dictionary(rch, a) -#else +#ifdef HAVE_LIBRADIUSCLIENT #define my_rc_conf_str(a) rc_conf_str(a) #define my_rc_send_server(a,b) rc_send_server(a, b) #define my_rc_buildreq(a,b,c,d,e,f) rc_buildreq(a,b,c,d,e,f) #define my_rc_own_ipaddress() rc_own_ipaddress() #define my_rc_avpair_add(a,b,c,d) rc_avpair_add(a, b, c, d) #define my_rc_read_dictionary(a) rc_read_dictionary(a) +#else +#define my_rc_conf_str(a) rc_conf_str(rch,a) +#define my_rc_send_server(a,b) rc_send_server(rch,a,b) +#define my_rc_buildreq(a,b,c,d,e,f) rc_buildreq(rch,a,b,c,d,e,f) +#define my_rc_own_ipaddress() rc_own_ipaddress(rch) +#define my_rc_avpair_add(a,b,c,d) rc_avpair_add(rch,a,b,c,-1,d) +#define my_rc_read_dictionary(a) rc_read_dictionary(rch, a) #endif /* REJECT_RC is only defined in some version of radiusclient. It has @@ -392,10 +395,10 @@ int my_rc_read_config(char * a) { -#ifdef HAVE_LIBRADIUSCLIENT_NG +#ifdef HAVE_LIBRADIUSCLIENT + return rc_read_config(a); +#else rch = rc_read_config(a); return (rch == NULL) ? 1 : 0; -#else - return rc_read_config(a); #endif } -- 1.8.5.1
signature.asc
Description: OpenPGP digital signature