mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
This adds a MIB from the Baicells website, lightly modified
(s/BAICELLS-MIB/BAICELLS-CPE-MIB), and yaml files for LibreNMS. Currently OS
detection works, but sensors are reporting '0'.
I can easily get the data with snmpget, so I know that part is working. The
issue I'm seeing looks like the {{ $index }} substitution in my sensor yaml
isn't being filled out. Here's some example output from poller.php that backs
this up:
```
.1.3.6.1.4.1.53058.2.2.7.: Unknown Object Identifier ()
.1.3.6.1.4.1.53058.2.2.8.: Unknown Object Identifier ()
.1.3.6.1.4.1.53058.2.2.12.: Unknown Object Identifier ()
.1.3.6.1.4.1.53058.2.2.13.: Unknown Object Identifier ()
```
* adjustments to baicells od04
* undo modification to mib
* add original unmodified mib, tweak yaml, add time conversion function
* added baicells od04 snmprec
* skip invalid values
* Rename baicells-od04.snmprec.txt to baicells-od04.snmprec
* Update and rename BaiCE-BM-2.5.23_SNMP_MIB-CAT4.txt to BAICELLS-MIB
* Update baicells-od04.yaml
* Create BaicellsOd04.php
* move userfunc into OS
* style
* squash php casting warning
* missing static
* style
* fix {{ $index }}
* Create baicells-od04.json
---------
Co-authored-by: PipoCanaja <[email protected]>
19 lines
329 B
PHP
Executable File
19 lines
329 B
PHP
Executable File
<?php
|
|
|
|
namespace LibreNMS\OS;
|
|
|
|
use LibreNMS\OS;
|
|
|
|
class BaicellsOd04 extends OS
|
|
{
|
|
/**
|
|
* convert hh:mm:ss to minutes (for yaml user_func)
|
|
*/
|
|
public static function hhmmss_to_minutes($duration)
|
|
{
|
|
[$h, $m, $s] = explode(':', $duration);
|
|
|
|
return (int) $h * 60 + (int) $m + (int) $s / 60;
|
|
}
|
|
}
|