Files

46 lines
1.5 KiB
PHP
Raw Permalink Normal View History

<?php
/*
* LibreNMS module to Graph Transcoder Resources in a Cisco Voice Router
*
* Copyright (c) 2015 Aaron Daniels <[email protected]>
*
* 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;
2020-09-21 15:59:34 +02:00
if ($device['os_group'] == 'cisco') {
// Total
2020-09-21 15:59:34 +02:00
$total = snmpwalk_cache_oid_num($device, '1.3.6.1.4.1.9.9.86.1.7.1.0', null);
2016-10-07 09:26:10 +01:00
$total = $total['1.3.6.1.4.1.9.9.86.1.7.1.0'][''];
if (isset($total) && $total > 0) {
// Available
2020-09-21 15:59:34 +02:00
$available = snmpwalk_cache_oid_num($device, '1.3.6.1.4.1.9.9.86.1.7.2.0', null);
2016-10-07 09:26:10 +01:00
$available = $available['1.3.6.1.4.1.9.9.86.1.7.2.0'][''];
// Active
$active = $total - $available;
$rrd_def = RrdDefinition::make()
->addDataset('total', 'GAUGE', 0)
->addDataset('active', 'GAUGE', 0);
2020-09-21 15:43:38 +02:00
$fields = [
'total' => $total,
'active' => $active,
2020-09-21 15:43:38 +02:00
];
$tags = compact('rrd_def');
data_update($device, 'cisco-iosxcode', $tags, $fields);
2015-08-19 20:58:02 +00:00
$os->enableGraph('cisco-iosxcode');
2020-09-21 15:59:34 +02:00
echo ' Cisco IOS Transcoder ';
}
unset($rrd_def, $total, $active, $available, $fields, $tags);
}