mirror of
https://github.com/librenms/librenms.git
synced 2024-09-22 02:48:37 +00:00
rename $state to $state_name (#11473)
rename $state to $state_name to keep better consistency with other modules
This commit is contained in:
parent
4df3310d4d
commit
3263839780
@ -4,7 +4,7 @@
|
||||
* requires snmp extend agent script from librenms-agent
|
||||
*/
|
||||
if (!empty($pre_cache['raspberry_pi_sensors'])) {
|
||||
$state = "raspberry_codec";
|
||||
$state_name = "raspberry_codec";
|
||||
$oid = '.1.3.6.1.4.1.8072.1.3.2.4.1.2.9.114.97.115.112.98.101.114.114.121.';
|
||||
for ($codec = 8; $codec < 14; $codec++) {
|
||||
switch ($codec) {
|
||||
@ -33,10 +33,10 @@ if (!empty($pre_cache['raspberry_pi_sensors'])) {
|
||||
['value' => 2, 'generic' => 0, 'graph' => 1, 'descr' => 'enabled'],
|
||||
['value' => 3, 'generic' => 2, 'graph' => 1, 'descr' => 'disabled'],
|
||||
];
|
||||
create_state_index($state, $states);
|
||||
create_state_index($state_name, $states);
|
||||
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid . $codec, $codec, $state, $descr, 1, 1, null, null, null, null, $value, 'snmp', $codec);
|
||||
create_sensor_to_state_index($device, $state, $codec);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid . $codec, $codec, $state_name, $descr, 1, 1, null, null, null, null, $value, 'snmp', $codec);
|
||||
create_sensor_to_state_index($device, $state_name, $codec);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user