Neil Lathwood 42e5819130 refactor: Updated discovery/poller to use numeric sysObjectID (#7922)
* refactor: Updated discovery to use a core module for sysDescr/sysObjectID use

* final update hopefully

* revert changes

* more changes + docs

* migrated poller to use numerical sysObjectID

* more updates for sysObjectID

* update any alert rules which might have enterprises. in

* moved schema file

* small updates

* updated getHostOS()

* scrut fixes

* updated sysObjectId -> sysObjectID

* updated sysObjectId -> sysObjectID

* updated remainder of sysObjectId -> sysObjectID

* another sysObjectId -> sysObjectID

* fixed secureplatform test data

* Fix tests: $device is not pulled from the database before polling
Also, update the db in the core discovery module.
2018-01-06 23:00:47 -06:00

46 lines
1.5 KiB
PHP

<?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.
*/
use LibreNMS\RRD\RrdDefinition;
$version = preg_replace('/[\r\n\"]+/', ' ', snmp_get($device, "productVersion.0", "-OQv", "PULSESECURE-PSG-MIB"));
$hardware = "Juniper " . preg_replace('/[\r\n\"]+/', ' ', snmp_get($device, "productName.0", "-OQv", "PULSESECURE-PSG-MIB"));
$hostname = trim($device['sysName'], '"');
$users = snmp_get($device, 'iveConcurrentUsers.0', '-OQv', 'PULSESECURE-PSG-MIB');
if (is_numeric($users)) {
$rrd_def = RrdDefinition::make()->addDataset('users', 'GAUGE', 0);
$fields = array(
'users' => $users,
);
$tags = compact('rrd_def');
data_update($device, 'pulse_users', $tags, $fields);
$graphs['pulse_users'] = true;
}
$sessions = snmp_get($device, 'iveConcurrentUsers.0', '-OQv', 'PULSESECURE-PSG-MIB');
if (is_numeric($sessions)) {
$rrd_def = RrdDefinition::make()->addDataset('sessions', 'GAUGE', 0);
$fields = array(
'sessions' => $sessions,
);
$tags = compact('rrd_def');
data_update($device, 'pulse_sessions', $tags, $fields);
$graphs['pulse_sessions'] = true;
}