New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add additional features to SAF Tehnika #4666
Changes from all commits
5395759
21eede3
e307963
262a8be
5df10f4
a93cee7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
require 'includes/graphs/common.inc.php'; | ||
|
||
$rrdfilename = rrd_name($device['hostname'], 'saf-modem-radio'); | ||
|
||
if (rrdtool_check_rrd_exists($rrdfilename)) { | ||
$rrd_options .= ' COMMENT:" Now Min Max\r" '; | ||
$rrd_options .= ' DEF:modemACMCapacity='.$rrdfilename.':modemACMCapacity:AVERAGE '; | ||
$rrd_options .= ' DEF:modemTotalCapacity='.$rrdfilename.':modemTotalCapacity:AVERAGE '; | ||
$rrd_options .= ' CDEF:acmCapacityMbps=modemACMCapacity,1000,* '; | ||
$rrd_options .= ' CDEF:capacityMbps=modemTotalCapacity,1000,* '; | ||
$rrd_options .= ' LINE1:acmCapacityMbps#00CC00:"ACM Total Capacity\l" '; | ||
$rrd_options .= ' COMMENT:\u '; | ||
$rrd_options .= ' GPRINT:acmCapacityMbps:LAST:"%0.2lf %sbps" '; | ||
$rrd_options .= ' GPRINT:acmCapacityMbps:MIN:"%0.2lf %sbps" '; | ||
$rrd_options .= ' GPRINT:acmCapacityMbps:MAX:"%0.2lf %sbps\r" '; | ||
$rrd_options .= ' LINE1:capacityMbps#CC0000:"Total Capacity\l" '; | ||
$rrd_options .= ' COMMENT:\u '; | ||
$rrd_options .= ' GPRINT:capacityMbps:LAST:"%0.2lf %sbps" '; | ||
$rrd_options .= ' GPRINT:capacityMbps:MIN:"%0.2lf %sbps" '; | ||
$rrd_options .= ' GPRINT:capacityMbps:MAX:"%0.2lf %sbps\r" '; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
require 'includes/graphs/common.inc.php'; | ||
|
||
$rrdfilename = rrd_name($device['hostname'], 'saf-modem-radio'); | ||
|
||
if (rrdtool_check_rrd_exists($rrdfilename)) { | ||
$rrd_options .= ' COMMENT:" Now Min Max\r" '; | ||
$rrd_options .= ' DEF:modemRadialMSE='.$rrdfilename.':modemRadialMSE:AVERAGE '; | ||
$rrd_options .= ' CDEF:dividedMSE=modemRadialMSE,10,/ '; | ||
$rrd_options .= ' LINE1:dividedMSE#CC0000:"Radial MSE\l" '; | ||
$rrd_options .= ' COMMENT:\u '; | ||
$rrd_options .= ' GPRINT:dividedMSE:LAST:"%3.2lf dB" '; | ||
$rrd_options .= ' GPRINT:dividedMSE:MIN:"%3.2lf dB" '; | ||
$rrd_options .= ' GPRINT:dividedMSE:MAX:"%3.2lf dB\r" '; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
require 'includes/graphs/common.inc.php'; | ||
|
||
$rrdfilename = rrd_name($device['hostname'], 'saf-modem-radio'); | ||
|
||
if (rrdtool_check_rrd_exists($rrdfilename)) { | ||
$rrd_options .= ' COMMENT:" Now Min Max\r" '; | ||
$rrd_options .= ' DEF:radioRxLevel='.$rrdfilename.':radioRxLevel:AVERAGE '; | ||
$rrd_options .= ' LINE1:radioRxLevel#CC0000:"RX Level\l" '; | ||
$rrd_options .= ' COMMENT:\u '; | ||
$rrd_options .= ' GPRINT:radioRxLevel:LAST:"%3.2lf dBm" '; | ||
$rrd_options .= ' GPRINT:radioRxLevel:MIN:"%3.2lf dBm" '; | ||
$rrd_options .= ' GPRINT:radioRxLevel:MAX:"%3.2lf dBm\r" '; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
require 'includes/graphs/common.inc.php'; | ||
|
||
$rrdfilename = rrd_name($device['hostname'], 'saf-modem-radio'); | ||
|
||
if (rrdtool_check_rrd_exists($rrdfilename)) { | ||
$rrd_options .= ' COMMENT:" Now Min Max\r" '; | ||
$rrd_options .= ' DEF:radioTxPower='.$rrdfilename.':radioTxPower:AVERAGE '; | ||
$rrd_options .= ' LINE1:radioTxPower#CC0000:"TX Power\l" '; | ||
$rrd_options .= ' COMMENT:\u '; | ||
$rrd_options .= ' GPRINT:radioTxPower:LAST:"%3.2lf dBm" '; | ||
$rrd_options .= ' GPRINT:radioTxPower:MIN:"%3.2lf dBm" '; | ||
$rrd_options .= ' GPRINT:radioTxPower:MAX:"%3.2lf dBm\r" '; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
if ($device['os'] == 'saf') { | ||
$mib = 'SAF-IPRADIO::sysTemperature'; | ||
$oid = '.1.3.6.1.4.1.7571.100.1.1.5.1.1.1.5'; | ||
$oids = snmp_get($device, $mib, '-OsqnU', 'SAF-IPRADIO'); | ||
d_echo($oids."\n"); | ||
|
||
if (!empty($oids)) { | ||
echo 'SAF Temperature '; | ||
|
||
$divisor = 1; | ||
$type = 'saf'; | ||
|
||
list(,$current) = explode(' ', $oids); | ||
$index = $oid; | ||
$descr = 'System Temp'; | ||
discover_sensor($valid['sensor'], 'temperature', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When storing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure I understand this one. So isn't using the MIB name the right way to do it if it does exist? or when you refer to numeric oid, you mean only when calling the discover_sensor and snmp_get is ok with MIB name? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah snmp_get is ok but storing the OID needs to be numerical. |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
if ($device['os'] == 'saf') { | ||
$oid = '.1.3.6.1.4.1.7571.100.1.1.5.15.1.2.0'; | ||
$oids = snmp_walk($device, "$oid", '-OsqnU', 'SAF-IPRADIO'); | ||
d_echo($oids."\n"); | ||
|
||
if (!empty($oids)) { | ||
echo 'SAF Voltage '; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move this + the other two variables into the |
||
|
||
$divisor = 1; | ||
$type = 'saf'; | ||
|
||
list(,$current) = explode(' ', $oids); | ||
$index = $oid; | ||
$descr = 'System voltage'; | ||
discover_sensor($valid['sensor'], 'voltage', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
echo ' SAF Tehnika '; | ||
|
||
$mib_oids = array( | ||
'radioRxLevel' => array( | ||
'local', | ||
'radioRxLevel', | ||
'RX Power', | ||
'GAUGE', | ||
), | ||
'radioTxPower' => array( | ||
'local', | ||
'radioTxPower', | ||
'TX Power', | ||
'GAUGE', | ||
), | ||
'modemRadialMSE' => array( | ||
'local', | ||
'modemRadialMSE', | ||
'Radial MSE', | ||
'GAUGE', | ||
), | ||
'modemACMtotalCapacity' => array( | ||
'local', | ||
'modemACMCapacity', | ||
'ACM Capacity', | ||
'GAUGE', | ||
), | ||
'modemTotalCapacity' => array( | ||
'local', | ||
'modemTotalCapacity', | ||
'Capacity', | ||
'GAUGE', | ||
), | ||
); | ||
|
||
$mib_graphs = array( | ||
'saf_radioRxLevel', | ||
'saf_radioTxPower', | ||
'saf_modemRadialMSE', | ||
'saf_modemCapacity', | ||
); | ||
|
||
unset($graph, $oids, $oid); | ||
|
||
poll_mib_def($device, 'SAF-IPRADIO:saf-modem-radio', 'saf', $mib_oids, $mib_graphs, $graphs); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
SAF-ENTERPRISE DEFINITIONS ::= BEGIN | ||
|
||
-- Definitions for include by other SAF Tehnika mib modules | ||
|
||
IMPORTS | ||
enterprises, | ||
MODULE-IDENTITY, | ||
OBJECT-IDENTITY FROM SNMPv2-SMI; | ||
|
||
|
||
-- saf OBJECT IDENTIFIER ::= { enterprises 7571 } | ||
saf MODULE-IDENTITY | ||
LAST-UPDATED "200704030000Z" -- Apr, 04. 2007 | ||
ORGANIZATION "SAF Tehnika" | ||
CONTACT-INFO | ||
"SAF Tehnika technical support | ||
<techsupport@saftehnika.com>" | ||
DESCRIPTION | ||
"SAF Tehnika enterprise spec." | ||
::= { enterprises 7571 } | ||
|
||
tehnika OBJECT-IDENTITY | ||
STATUS current | ||
DESCRIPTION | ||
"Subtree to register SAF tehnika modules" | ||
::= { saf 100 } | ||
|
||
-- smiv1 | ||
|
||
microwaveRadio OBJECT IDENTIFIER ::= { tehnika 1} | ||
pointToPoint OBJECT IDENTIFIER ::= { microwaveRadio 1 } | ||
-- end smiv1 | ||
|
||
-- | ||
END |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not move this to the next
if (!empty($oids)) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed! Just based my work to much on previous files from other brands and i should have been trying to improve the code as a whole! Will arrange it ASAP. Same for other comments regarding voltage and temperature discovery files