aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_radius.c
diff options
context:
space:
mode:
authorGravatar Jan Wagner <waja@cyconet.org> 2016-11-05 17:22:39 +0100
committerGravatar Holger Weiss <holger@zedat.fu-berlin.de> 2016-11-15 23:21:40 +0100
commit2c898cf23f10962fe63ba15904c57fd63962e346 (patch)
treee79862d5826ab8cd4e1322f5f9f099eb934ebcb6 /plugins/check_radius.c
parent2f845e9ebc2b7bcf6472e0191752215d351e4e7c (diff)
downloadmonitoring-plugins-2c898cf23f10962fe63ba15904c57fd63962e346.tar.gz
This patch adds support for using the readcli lib.
http://radcli.github.io/radcli/ (Closes #1437)
Diffstat (limited to 'plugins/check_radius.c')
-rw-r--r--plugins/check_radius.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/check_radius.c b/plugins/check_radius.c
index 03cbb8b0..43dffad2 100644
--- a/plugins/check_radius.c
+++ b/plugins/check_radius.c
@@ -36,7 +36,9 @@ const char *email = "devel@monitoring-plugins.org";
#include "utils.h"
#include "netutils.h"
-#if defined(HAVE_LIBFREERADIUS_CLIENT)
+#if defined(HAVE_LIBRADCLI)
+#include <radcli/radcli.h>
+#elif defined(HAVE_LIBFREERADIUS_CLIENT)
#include <freeradius-client.h>
#elif defined(HAVE_LIBRADIUSCLIENT_NG)
#include <radiusclient-ng.h>
@@ -48,10 +50,10 @@ int process_arguments (int, char **);
void print_help (void);
void print_usage (void);
-#if defined(HAVE_LIBFREERADIUS_CLIENT) || defined(HAVE_LIBRADIUSCLIENT_NG)
+#if defined(HAVE_LIBFREERADIUS_CLIENT) || defined(HAVE_LIBRADIUSCLIENT_NG) || defined(HAVE_LIBRADCLI)
#define my_rc_conf_str(a) rc_conf_str(rch,a)
#define my_rc_send_server(a,b) rc_send_server(rch,a,b)
-#ifdef HAVE_LIBFREERADIUS_CLIENT
+#if defined(HAVE_LIBFREERADIUS_CLIENT) || defined(HAVE_LIBRADCLI)
#define my_rc_buildreq(a,b,c,d,e,f) rc_buildreq(rch,a,b,c,d,(a)->secret,e,f)
#else
#define my_rc_buildreq(a,b,c,d,e,f) rc_buildreq(rch,a,b,c,d,e,f)
@@ -76,7 +78,7 @@ void print_usage (void);
int my_rc_read_config(char *);
-#if defined(HAVE_LIBFREERADIUS_CLIENT) || defined(HAVE_LIBRADIUSCLIENT_NG)
+#if defined(HAVE_LIBFREERADIUS_CLIENT) || defined(HAVE_LIBRADIUSCLIENT_NG) || defined(HAVE_LIBRADCLI)
rc_handle *rch = NULL;
#endif
@@ -399,7 +401,7 @@ print_usage (void)
int my_rc_read_config(char * a)
{
-#if defined(HAVE_LIBFREERADIUS_CLIENT) || defined(HAVE_LIBRADIUSCLIENT_NG)
+#if defined(HAVE_LIBFREERADIUS_CLIENT) || defined(HAVE_LIBRADIUSCLIENT_NG) || defined(HAVE_LIBRADCLI)
rch = rc_read_config(a);
return (rch == NULL) ? 1 : 0;
#else