mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 08:02:41 +02:00
Merge branch 'master' of https://github.com/librenms/librenms into issue-1936
This commit is contained in:
@@ -375,8 +375,6 @@ $config['show_overview_tab'] = true;
|
||||
// The device overview page options
|
||||
$config['overview_show_sysDescr'] = true;
|
||||
|
||||
// Enable version checker & stats
|
||||
$config['version_check'] = 0;
|
||||
// Enable checking of version in discovery
|
||||
// Poller/Discovery Modules
|
||||
$config['enable_bgp'] = 1;
|
||||
|
||||
@@ -214,7 +214,7 @@ $config['os'][$os]['group'] = 'unix';
|
||||
$config['os'][$os]['text'] = 'FreeBSD';
|
||||
|
||||
$os = 'pfsense';
|
||||
$config['os'][$os]['type'] = 'server';
|
||||
$config['os'][$os]['type'] = 'firewall';
|
||||
$config['os'][$os]['group'] = 'unix';
|
||||
$config['os'][$os]['text'] = 'pfSense';
|
||||
|
||||
@@ -553,6 +553,18 @@ $config['os'][$os]['over'][1]['text'] = 'CPU Usage';
|
||||
$config['os'][$os]['over'][2]['graph'] = 'device_mempool';
|
||||
$config['os'][$os]['over'][2]['text'] = 'Memory Usage';
|
||||
|
||||
// Pulse Secure OS definition
|
||||
$os = 'pulse';
|
||||
$config['os'][$os]['text'] = 'Pulse Secure';
|
||||
$config['os'][$os]['type'] = 'firewall';
|
||||
$config['os'][$os]['icon'] = 'junos';
|
||||
$config['os'][$os]['over'][0]['graph'] = 'device_bits';
|
||||
$config['os'][$os]['over'][0]['text'] = 'Device Traffic';
|
||||
$config['os'][$os]['over'][1]['graph'] = 'device_processor';
|
||||
$config['os'][$os]['over'][1]['text'] = 'CPU Usage';
|
||||
$config['os'][$os]['over'][2]['graph'] = 'device_mempool';
|
||||
$config['os'][$os]['over'][2]['text'] = 'Memory Usage';
|
||||
|
||||
$os = 'fortigate';
|
||||
$config['os'][$os]['text'] = 'Fortinet Fortigate';
|
||||
$config['os'][$os]['type'] = 'firewall';
|
||||
@@ -1319,6 +1331,14 @@ $config['os'][$os]['icon'] = 'hp';
|
||||
$config['os'][$os]['over'][0]['graph'] = 'device_bits';
|
||||
$config['os'][$os]['over'][0]['text'] = 'Traffic';
|
||||
|
||||
// Riverbed
|
||||
$os = 'riverbed';
|
||||
$config['os'][$os]['text'] = 'Riverbed';
|
||||
$config['os'][$os]['type'] = 'network';
|
||||
$config['os'][$os]['icon'] = 'riverbed';
|
||||
$config['os'][$os]['over'][0]['graph'] = 'device_bits';
|
||||
$config['os'][$os]['over'][0]['text'] = 'Traffic';
|
||||
|
||||
// Appliances
|
||||
$os = 'fortios';
|
||||
$config['os'][$os]['text'] = 'FortiOS';
|
||||
@@ -1494,6 +1514,14 @@ $config['graph_types']['device']['panos_sessions']['section'] = 'firewall';
|
||||
$config['graph_types']['device']['panos_sessions']['order'] = '0';
|
||||
$config['graph_types']['device']['panos_sessions']['descr'] = 'Active Sessions';
|
||||
|
||||
//Pulse Secure Graphs
|
||||
$config['graph_types']['device']['pulse_users']['section'] = 'firewall';
|
||||
$config['graph_types']['device']['pulse_users']['order'] = '0';
|
||||
$config['graph_types']['device']['pulse_users']['descr'] = 'Active Users';
|
||||
$config['graph_types']['device']['pulse_sessions']['section'] = 'firewall';
|
||||
$config['graph_types']['device']['pulse_sessions']['order'] = '0';
|
||||
$config['graph_types']['device']['pulse_sessions']['descr'] = 'Active Sessions';
|
||||
|
||||
$config['graph_types']['device']['bits']['section'] = 'netstats';
|
||||
$config['graph_types']['device']['bits']['order'] = '0';
|
||||
$config['graph_types']['device']['bits']['descr'] = 'Total Traffic';
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
//
|
||||
// Hardcoded discovery of Memory usage on Pulse Secure devices.
|
||||
//
|
||||
if ($device['os'] == 'pulse') {
|
||||
echo 'PULSE-MEMORY-POOL: ';
|
||||
|
||||
$usage = str_replace('"', "", snmp_get($device, 'PULSESECURE-PSG-MIB::iveMemoryUtil.0', '-OvQ'));
|
||||
|
||||
if (is_numeric($usage)) {
|
||||
discover_mempool($valid_mempool, $device, 0, 'pulse-mem', 'Main Memory', '100', null, null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?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.
|
||||
*/
|
||||
if (!$os) {
|
||||
if (strstr($sysDescr, 'Pulse Connect Secure')) {
|
||||
$os = 'pulse';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/*
|
||||
* LibreNMS
|
||||
*
|
||||
* Copyright (c) 2015 Søren Friis Rosiak <sorenrosiak@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.
|
||||
*/
|
||||
if (!$os) {
|
||||
if (strpos($sysObjectId, '1.3.6.1.4.1.17163.1.1') !== false) {
|
||||
$os = 'riverbed';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?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.
|
||||
*/
|
||||
//
|
||||
// Hardcoded discovery of CPU usage on Pulse Secure devices.
|
||||
//
|
||||
if ($device['os'] == 'pulse') {
|
||||
echo 'Pulse Secure : ';
|
||||
|
||||
$descr = 'Processor';
|
||||
$usage = str_replace('"', "", snmp_get($device, 'PULSESECURE-PSG-MIB::iveCpuUtil.0', '-OvQ'));
|
||||
|
||||
if (is_numeric($usage)) {
|
||||
discover_processor($valid['processor'], $device, 'PULSESECURE-PSG-MIB::iveCpuUtil.0', '0', 'pulse-cpu', $descr,
|
||||
'100', $usage, null, null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
echo ' OPENBSD-SENSORS-MIB: ';
|
||||
|
||||
echo 'Caching OIDs:';
|
||||
|
||||
$oids = array();
|
||||
echo ' sensorDevice';
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'sensorDevice', $oids, 'OPENBSD-SENSORS-MIB');
|
||||
echo ' sensorDescr';
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'sensorDescr', $oids, 'OPENBSD-SENSORS-MIB');
|
||||
echo ' sensorValue';
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'sensorValue', $oids, 'OPENBSD-SENSORS-MIB');
|
||||
echo ' sensorType';
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'sensorType', $oids, 'OPENBSD-SENSORS-MIB');
|
||||
|
||||
# temperature(0), fan(1), voltsdc(2), voltsac(3), resistance(4), power(5),
|
||||
# current(6), watthour(7), amphour(8), indicator(9), raw(10), percent(11),
|
||||
# illuminance(12), drive(13), timedelta(14), humidity(15), freq(16),
|
||||
# angle(17), distance(18), pressure(19), accel(20)
|
||||
|
||||
$entitysensor['voltsdc'] = 'voltage';
|
||||
$entitysensor['voltsac'] = 'voltage';
|
||||
$entitysensor['fan'] = 'fanspeed';
|
||||
|
||||
$entitysensor['current'] = 'current';
|
||||
$entitysensor['power'] = 'power';
|
||||
$entitysensor['freq'] = 'freq';
|
||||
$entitysensor['humidity'] = 'humidity';
|
||||
$entitysensor['temperature'] = 'temperature';
|
||||
|
||||
if (is_array($oids)) {
|
||||
foreach ($oids as $index => $entry) {
|
||||
// echo("[" . $entry['sensorType'] . "|" . $entry['sensorValue']. "|" . $index . "] ");
|
||||
if ($entitysensor[$entry['sensorType']] && is_numeric($entry['sensorValue']) && is_numeric($index)) {
|
||||
$entPhysicalIndex = $index;
|
||||
$oid = '.1.3.6.1.4.1.30155.2.1.2.1.5.'.$index;
|
||||
$current = $entry['sensorValue'];
|
||||
$descr = $entry['sensorDevice'].' '.$entry['sensorDescr'];
|
||||
$bogus = false;
|
||||
|
||||
$type = $entitysensor[$entry['sensorType']];
|
||||
|
||||
if ($type == 'voltage') {
|
||||
$descr = preg_replace('/ voltage/i', '', $descr);
|
||||
}
|
||||
|
||||
if ($type == 'temperature') {
|
||||
if ($current < -40 || $current > 200) {
|
||||
$bogus = true;
|
||||
}
|
||||
$descr = preg_replace('/ temperature/i', '', $descr);
|
||||
}
|
||||
|
||||
// echo($descr . "|" . $index . "|" .$current . "|" . $bogus . "\n");
|
||||
if (! $bogus) {
|
||||
discover_sensor($valid['sensor'], $type, $device, $oid, $index, 'openbsd-sensor', $descr, '1', '1', null, null, null, null, $current);
|
||||
}
|
||||
}//end if
|
||||
}//end foreach
|
||||
}//end if
|
||||
|
||||
echo "\n";
|
||||
@@ -12,6 +12,10 @@ if ($device['os'] == 'netscaler') {
|
||||
include 'includes/discovery/sensors-netscaler.inc.php';
|
||||
}
|
||||
|
||||
if ($device['os'] == 'openbsd') {
|
||||
include 'includes/discovery/sensors-openbsd.inc.php';
|
||||
}
|
||||
|
||||
require 'includes/discovery/temperatures.inc.php';
|
||||
require 'includes/discovery/humidity.inc.php';
|
||||
require 'includes/discovery/voltages.inc.php';
|
||||
|
||||
@@ -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";
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
/*
|
||||
* LibreNMS
|
||||
*
|
||||
* Copyright (c) 2015 Søren Friis Rosiak <sorenrosiak@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.
|
||||
*/
|
||||
$hardware = trim(snmp_get($device, '.1.3.6.1.4.1.17163.1.1.1.1.0', '-OQv'), '"');
|
||||
$serial = trim(snmp_get($device, '.1.3.6.1.4.1.17163.1.1.1.2.0', '-OQv'), '"');
|
||||
$version = trim(snmp_get($device, '.1.3.6.1.4.1.17163.1.1.1.3.0', '-OQv'), '"');
|
||||
@@ -318,7 +318,7 @@ foreach ($ports as $port) {
|
||||
foreach ($data_oids as $oid) {
|
||||
|
||||
if ($oid == 'ifAlias') {
|
||||
if (get_dev_attrib($device, 'ifName', $port['ifName'])) {
|
||||
if (get_dev_attrib($device, 'ifName:'.$port['ifName'], 1)) {
|
||||
$this_port['ifAlias'] = $port['ifAlias'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
<?php
|
||||
|
||||
// FIXME: This really does produce valuable data for the project team. We
|
||||
// need to get some infrastructure going and make it available on an opt-in
|
||||
// basis (i.e. disabled by default). We should schedule it from cron rather
|
||||
// than putting it into the discovery process.
|
||||
// See https://github.com/librenms/librenms/issues/25 for some thoughts on where to go with this code under git.
|
||||
/*
|
||||
// Generate some statistics to send along with the version request.
|
||||
|
||||
$stats['ports'] = dbFetchCell("SELECT count(*) FROM ports");
|
||||
$stats['devices'] = dbFetchCell("SELECT count(*) FROM devices");
|
||||
$stats['sensors'] = dbFetchCell("SELECT count(*) FROM sensors");
|
||||
$stats['services'] = dbFetchCell("SELECT count(*) FROM services");
|
||||
$stats['applications'] = dbFetchCell("SELECT count(*) FROM applications");
|
||||
$stats['bgp'] = dbFetchCell("SELECT count(*) FROM bgpPeers");
|
||||
|
||||
foreach (dbFetch("SELECT COUNT(*) AS count,os from devices group by `os`") as $dt_data)
|
||||
{
|
||||
$stats['devicetypes'][$dt_data['os']] = $dt_data['count'];
|
||||
}
|
||||
|
||||
$stat_serial = base64_encode(serialize($stats));
|
||||
|
||||
#$url = "http://www.observium.org/latest.php?i=".$stats['ports']."&d=".$stats['devices']."&stats=".$stat_serial."&v=".$config['version'];
|
||||
#$dataHandle = fopen($url, r);
|
||||
|
||||
if ($dataHandle)
|
||||
{
|
||||
while (!feof($dataHandle))
|
||||
{
|
||||
$data.= fread($dataHandle, 4096);
|
||||
}
|
||||
if ($data)
|
||||
{
|
||||
list($omnipotence, $year, $month, $revision) = explode(".", $data);
|
||||
list($cur, $tag) = explode("-", $config['version']);
|
||||
list($cur_omnipotence, $cur_year, $cur_month, $cur_revision) = explode(".", $cur);
|
||||
|
||||
if ($argv[1] == "--cron" || isset($options['q']))
|
||||
{
|
||||
$fd = fopen($config['log_file'],'a');
|
||||
fputs($fd,$string . "\n");
|
||||
fclose($fd);
|
||||
|
||||
shell_exec("echo $omnipotence.$year.$month.$month > ".$config['rrd_dir']."/version.txt ");
|
||||
} else {
|
||||
if ($cur != $data)
|
||||
{
|
||||
echo("Current Revision : $cur_revision\n");
|
||||
|
||||
if ($omnipotence > $cur_revision)
|
||||
{
|
||||
echo("New Revision : $omnipotence\n");
|
||||
}
|
||||
|
||||
# if ($omnipotence > $cur_omnipotence)
|
||||
# {
|
||||
# echo("New version : $omnipotence.$year.$month.$revision\n");
|
||||
# } elseif ($year > $cur_year) {
|
||||
# echo("New version : $omnipotence.$year.$month.$revision\n");
|
||||
# } elseif ($month > $cur_month) {
|
||||
# echo("New version : $omnipotence.$year.$month.$revision\n");
|
||||
# } elseif ($revision > $cur_revision) {
|
||||
# echo("New release : $omnipotence.$year.$month.$revision\n");
|
||||
# }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fclose($dataHandle);
|
||||
}
|
||||
*/
|
||||
Reference in New Issue
Block a user