Merge pull request #2053 from chrisgfx/issue-1870

Issue 1870 : Pulse Secure OS support
This commit is contained in:
Neil Lathwood
2015-10-10 10:28:01 +01:00
11 changed files with 968 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
<?php
/*
* LibreNMS Pulse Secure OS information module
*
* Copyright (c) 2015 Christophe Martinet Chrisgfx <martinet.christophe@gmail.com>
* 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.
*/
// Simple hard-coded poller for Pulse Secure
// Yes, it really can be this simple.
echo 'Pulse Secure MemPool'.'\n';
if ($device['os'] == 'pulse') {
$perc = str_replace('"', "", snmp_get($device, "PULSESECURE-PSG-MIB::iveMemoryUtil.0", '-OvQ'));
$memory_available = str_replace('"', "", snmp_get($device, "UCD-SNMP-MIB::memTotalReal.0", '-OvQ'));
$mempool['total'] = $memory_available;
if (is_numeric($perc)) {
$mempool['used'] = ($memory_available / 100 * $perc);
$mempool['free'] = ($memory_available - $mempool['used']);
}
echo "PERC " .$perc."%\n";
echo "Avail " .$mempool['total']."\n";
}

View File

@@ -0,0 +1,37 @@
<?php
/*
* LibreNMS Pulse Secure OS information module
*
* Copyright (c) 2015 Christophe Martinet Chrisgfx <martinet.christophe@gmail.com>
* 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;
}

View File

@@ -0,0 +1,23 @@
<?php
/*
* LibreNMS Pulse Secure OS information module
*
* Copyright (c) 2015 Christophe Martinet Chrisgfx <martinet.christophe@gmail.com>
* 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.
*/
// Simple hard-coded poller for Pulse Secure
// Yes, it really can be this simple.
echo 'Pulse Secure CPU Usage';
if ($device['os'] == 'pulse') {
$usage = str_replace('"', "", snmp_get($device, 'PULSESECURE-PSG-MIB::iveCpuUtil.0', '-OvQ'));
if (is_numeric($usage)) {
$proc = ($usage * 100);
}
}