2015-07-28 07:17:53 +10:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
* LibreNMS module to Graph Hardware MTP Resources in a Cisco Voice Router
|
|
|
|
*
|
|
|
|
* Copyright (c) 2015 Aaron Daniels <aaron@daniels.id.au>
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2017-02-23 22:45:50 +00:00
|
|
|
use LibreNMS\RRD\RrdDefinition;
|
|
|
|
|
2015-07-28 07:17:53 +10:00
|
|
|
if ($device['os_group'] == 'cisco') {
|
|
|
|
// Total
|
2024-08-21 05:22:37 -05:00
|
|
|
$total = SnmpQuery::get('1.3.6.1.4.1.9.9.86.1.6.4.1.3')->value();
|
2015-07-28 07:17:53 +10:00
|
|
|
|
2016-10-13 22:17:30 +01:00
|
|
|
if (isset($total) && $total > 0) {
|
2015-07-28 07:17:53 +10:00
|
|
|
// Available
|
2024-08-21 05:22:37 -05:00
|
|
|
$available = SnmpQuery::get('1.3.6.1.4.1.9.9.86.1.6.4.1.4')->value();
|
2015-07-28 07:17:53 +10:00
|
|
|
|
|
|
|
// Active
|
|
|
|
$active = $total - $available;
|
|
|
|
|
2017-02-23 22:45:50 +00:00
|
|
|
$rrd_def = RrdDefinition::make()
|
|
|
|
->addDataset('total', 'GAUGE', 0)
|
|
|
|
->addDataset('active', 'GAUGE', 0);
|
2015-08-18 16:26:55 +00:00
|
|
|
|
|
|
|
$fields = [
|
2024-01-05 05:39:12 +01:00
|
|
|
'total' => $total,
|
2015-08-18 16:26:55 +00:00
|
|
|
'active' => $active,
|
|
|
|
];
|
|
|
|
|
2016-07-07 01:33:43 -05:00
|
|
|
$tags = compact('rrd_def');
|
|
|
|
data_update($device, 'cisco-iosmtp', $tags, $fields);
|
2015-08-19 20:58:02 +00:00
|
|
|
|
2020-07-23 09:57:22 -05:00
|
|
|
$os->enableGraph('cisco-iosmtp');
|
2015-08-01 14:48:54 +10:00
|
|
|
echo ' Cisco IOS MTP ';
|
2015-07-28 07:17:53 +10:00
|
|
|
}
|
2016-07-07 01:33:43 -05:00
|
|
|
unset($rrd_def, $total, $active, $available, $fields, $tags);
|
2015-08-18 16:26:55 +00:00
|
|
|
}
|