From 6fdcb035774ff5e9d64f56d9613b132eddc9515c Mon Sep 17 00:00:00 2001 From: chrisgfx Date: Sat, 3 Oct 2015 11:49:42 +0200 Subject: [PATCH] Create pulse.inc.php --- includes/polling/os/pulse.inc.php | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 includes/polling/os/pulse.inc.php diff --git a/includes/polling/os/pulse.inc.php b/includes/polling/os/pulse.inc.php new file mode 100644 index 000000000..f52d9ac0c --- /dev/null +++ b/includes/polling/os/pulse.inc.php @@ -0,0 +1,37 @@ + + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. Please see LICENSE.txt at the top level of + * the source code distribution for details. +*/ + +$version = trim(snmp_get($device, "productVersion.0", "-OQv", "PULSESECURE-PSG-MIB"),'"'); +$hardware = "Juniper " . trim(snmp_get($device, "productName.0", "-OQv", "PULSESECURE-PSG-MIB"),'"'); +$hostname = trim(snmp_get($device, "sysName.0", "-OQv", "SNMPv2-MIB"),'"'); + +$usersrrd = $config['rrd_dir'].'/'.$device['hostname'].'/pulse_users.rrd'; +$users = snmp_get($device, 'PULSESECURE-PSG-MIB::iveConcurrentUsers.0', '-OQv'); + +if (is_numeric($users)) { + if (!is_file($usersrrd)) { + rrdtool_create($usersrrd, ' DS:users:GAUGE:600:0:U'.$config['rrd_rra']); + } + rrdtool_update($usersrrd, "N:$users"); + $graphs['pulse_users'] = true; +} + +$sessrrd = $config['rrd_dir'].'/'.$device['hostname'].'/pulse_sessions.rrd'; +$sessions = snmp_get($device, 'PULSESECURE-PSG-MIB::iveConcurrentUsers.0', '-OQv'); + +if (is_numeric($sessions)) { + if (!is_file($sessrrd)) { + rrdtool_create($sessrrd, ' DS:sessions:GAUGE:600:0:U '.$config['rrd_rra']); + } + rrdtool_update($sessrrd, "N:$sessions"); + $graphs['pulse_sessions'] = true; +}