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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
if ($device['os_group'] == "cisco") {
|
|
|
|
// Total
|
2016-08-28 12:32:58 -05:00
|
|
|
$total = snmpwalk_cache_oid_num($device, "1.3.6.1.4.1.9.9.86.1.6.4.1.3", null);
|
2016-10-06 15:20:11 -05:00
|
|
|
$total = $total['1.3.6.1.4.1.9.9.86.1.6.4.1.3'];
|
|
|
|
// FIXME why isn't this using an snmpget?
|
2015-07-28 07:17:53 +10:00
|
|
|
|
|
|
|
if (isset($total) && ($total != "") && ($total != 0)) {
|
|
|
|
// Available
|
2016-08-28 12:32:58 -05:00
|
|
|
$available = snmpwalk_cache_oid_num($device, "1.3.6.1.4.1.9.9.86.1.6.4.1.4", null);
|
2016-10-06 15:20:11 -05:00
|
|
|
$available = $available['1.3.6.1.4.1.9.9.86.1.6.4.1.4'];
|
2015-07-28 07:17:53 +10:00
|
|
|
|
|
|
|
// Active
|
|
|
|
$active = $total - $available;
|
|
|
|
|
2016-07-07 01:33:43 -05:00
|
|
|
$rrd_def = array(
|
|
|
|
'DS:total:GAUGE:600:0:U',
|
|
|
|
'DS:active:GAUGE:600:0:U'
|
|
|
|
);
|
2015-08-18 16:26:55 +00:00
|
|
|
|
|
|
|
$fields = array(
|
|
|
|
'total' => $total,
|
|
|
|
'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
|
|
|
|
2016-08-28 12:32:58 -05:00
|
|
|
$graphs['cisco-iosmtp'] = true;
|
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
|
|
|
}
|