Mikrotik UPS SNMP

I’m struggling to get UPS data to appear for Mikrotik RouterOS devices that have USB UPS’ connected.

The data is available - but I can’t for the life of me work out how to get it to display. Is there a configuration change that I need to make. I’ve tried re-discovering the device, polling it etc - but no luck.

.1.3.6.1.2.1.33.1.1.2.0 = STRING: "Value1500E"
.1.3.6.1.2.1.33.1.1.3.0 = ""
.1.3.6.1.2.1.33.1.2.1.0 = INTEGER: 2
.1.3.6.1.2.1.33.1.2.3.0 = INTEGER: 2921
.1.3.6.1.2.1.33.1.2.4.0 = INTEGER: 100
.1.3.6.1.2.1.33.1.2.5.0 = INTEGER: 0
.1.3.6.1.2.1.33.1.2.7.0 = INTEGER: 0
.1.3.6.1.2.1.33.1.3.2.0 = INTEGER: 1
.1.3.6.1.2.1.33.1.3.3.1.2.1 = INTEGER: 0
.1.3.6.1.2.1.33.1.3.3.1.3.1 = INTEGER: 247
.1.3.6.1.2.1.33.1.4.3.0 = INTEGER: 1
.1.3.6.1.2.1.33.1.4.4.1.2.1 = INTEGER: 247
.1.3.6.1.2.1.33.1.4.4.1.5.1 = INTEGER: 14
.1.3.6.1.2.1.33.1.6.1.0 = Gauge32: 0

The OID information from the router is

[[email protected]] /system ups> print oid
Flags: X - disabled, I - invalid 
 0    model=.1.3.6.1.2.1.33.1.1.2 version=.1.3.6.1.2.1.33.1.1.3 status=.1.3.6.1.2.1.33.1.2.1 remaining=.1.3.6.1.2.1.33.1.2.3 battery-charge=.1.3.6.1.2.1.33.1.2.4 voltage=.1.3.6.1.2.1.33.1.2.5 
      temperature=.1.3.6.1.2.1.33.1.2.7 replace-battery=.1.3.6.1.2.1.33.1.6.2.1.2.1 low-battery=.1.3.6.1.2.1.33.1.6.2.1.2.2 overload=.1.3.6.1.2.1.33.1.6.2.1.2.3 line-voltage=.1.3.6.1.2.1.33.1.3.3.1.3.1 
      frequency=.1.3.6.1.2.1.33.1.3.3.1.2.1 output-voltage=.1.3.6.1.2.1.33.1.4.4.1.2.1 load=.1.3.6.1.2.1.33.1.4.4.1.5.1 

You may want to submit the issue in git hub with all required info asking for support for that sensor.

GitHub

Or you can code it yourself and make a pull request.

https://docs.librenms.org/Developing/os/Health-Information/

Cheers Kevin, I’ve updated the file and created a pull request.

1 Like

Awesome thank you :+1::+1:

Per the conversation in the pull request - I’m now trying to use rfc1628_compat: 1

However the divisor doesn’t appear to be working per code:

    } elseif ($device['os'] == 'routeros') {
        if ($sensor_type == 'runtime') {
            return 60;
        }
    }

I’ve tried rm cache/os_defs.cache with no luck.

29 AM

Example discovery and poll

[root@mon001 librenms]# ./discovery.php -h 999 && ./poller.php -h 999
LibreNMS Discovery
ROUTEROS.example.com 5 routeros 

#### Load disco module os ####

>> Runtime for discovery module 'os': 0.2030 seconds with 888 bytes
#### Unload disco module os ####


#### Load disco module ports ####
..........................X............................................................X.....

>> Runtime for discovery module 'ports': 32.9200 seconds with 2216 bytes
#### Unload disco module ports ####


#### Load disco module ports-stack ####


>> Runtime for discovery module 'ports-stack': 0.1730 seconds with 640 bytes
#### Unload disco module ports-stack ####


#### Load disco module entity-physical ####

Caching OIDs: entPhysicalEntry entAliasMappingIdentifier......

>> Runtime for discovery module 'entity-physical': 8.7770 seconds with 3832 bytes
#### Unload disco module entity-physical ####


#### Load disco module processors ####
 hrDevice: ................

>> Runtime for discovery module 'processors': 13.1000 seconds with 46536 bytes
#### Unload disco module processors ####


#### Load disco module mempools ####
hrStorage : .

>> Runtime for discovery module 'mempools': 2.9680 seconds with 25928 bytes
#### Unload disco module mempools ####


#### Load disco module cisco-vrf-lite ####

>> Runtime for discovery module 'cisco-vrf-lite': 0.0000 seconds with 1592 bytes
#### Unload disco module cisco-vrf-lite ####

Module [ cisco-mac-accounting ] disabled globally.

Module [ cisco-pw ] disabled globally.

Module [ cisco-vrf ] disabled globally.

Module [ cisco-cef ] disabled globally.

Module [ cisco-sla ] disabled globally.

Module [ cisco-cbqos ] disabled globally.

Module [ cisco-otv ] disabled globally.


#### Load disco module ipv4-addresses ####
s.s.s.s.s.s.s.s.!!s.s.s.s.s.s.s.

>> Runtime for discovery module 'ipv4-addresses': 3.2690 seconds with 31376 bytes
#### Unload disco module ipv4-addresses ####


#### Load disco module ipv6-addresses ####
n.n.n.n.

>> Runtime for discovery module 'ipv6-addresses': 4.4600 seconds with 19592 bytes
#### Unload disco module ipv6-addresses ####


#### Load disco module route ####

>> Runtime for discovery module 'route': 0.0000 seconds with 1376 bytes
#### Unload disco module route ####


#### Load disco module sensors ####
 ENTITY-SENSOR: Caching OIDs: entPhysicalDescr entPhysicalName entPhySensorType entPhySensorScale entPhySensorPrecision entPhySensorValue
Airflow: 
Current: MIKROTIK-MIB .RFC1628 ...........
Charge: RFC1628 .
Dbm: ..................
Fanspeed: MIKROTIK-MIB .
Frequency: RFC1628 .
Humidity: 
Load: RFC1628 .
Power: MIKROTIK-MIB  .RFC1628 
Runtime: RFC1628 .
Signal: MIKROTIK-MIB 
State: RFC1628 ...................
Temperature: MIKROTIK-MIB ..RFC1628 Battery Temperature ..........
Voltage: MIKROTIK-MIB .RFC1628 ............
Snr: 

>> Runtime for discovery module 'sensors': 15.4800 seconds with 21576 bytes
#### Unload disco module sensors ####


#### Load disco module storage ####
hrStorage : ...

>> Runtime for discovery module 'storage': 3.0250 seconds with 6880 bytes
#### Unload disco module storage ####


#### Load disco module hr-device ####
................

>> Runtime for discovery module 'hr-device': 11.3000 seconds with 19968 bytes
#### Unload disco module hr-device ####


#### Load disco module discovery-protocols ####
 CISCO-CDP-MIB:  LLDP-MIB:  OSPF Discovery: enabled


>> Runtime for discovery module 'discovery-protocols': 5.7520 seconds with 8568 bytes
#### Unload disco module discovery-protocols ####


#### Load disco module arp-table ####
.
-

>> Runtime for discovery module 'arp-table': 8.0840 seconds with 141296 bytes
#### Unload disco module arp-table ####

Module [ discovery-arp ] disabled on host.

Module [ junose-atm-vp ] disabled globally.


#### Load disco module bgp-peers ####
No BGP on host

>> Runtime for discovery module 'bgp-peers': 0.2270 seconds with 2672 bytes
#### Unload disco module bgp-peers ####


#### Load disco module vlans ####
IEEE8021-Q-BRIDGE-MIB VLANs: 

>> Runtime for discovery module 'vlans': 0.2610 seconds with 4456 bytes
#### Unload disco module vlans ####

Module [ vmware-vminfo ] disabled globally.

Module [ libvirt-vminfo ] disabled globally.

Module [ toner ] disabled globally.


#### Load disco module ucd-diskio ####


>> Runtime for discovery module 'ucd-diskio': 0.1470 seconds with 736 bytes
#### Unload disco module ucd-diskio ####

Module [ applications ] disabled globally.


#### Load disco module services ####

>> Runtime for discovery module 'services': 0.0000 seconds with 312 bytes
#### Unload disco module services ####


#### Load disco module stp ####
STP 

>> Runtime for discovery module 'stp': 0.5550 seconds with 5056 bytes
#### Unload disco module stp ####


#### Load disco module ntp ####

>> Runtime for discovery module 'ntp': 0.0000 seconds with 144 bytes
#### Unload disco module ntp ####

Module [ loadbalancers ] disabled globally.

Module [ mef ] disabled globally.


#### Load disco module wireless ####
clients: 
rate: 
ccq: 
noise-floor: 
frequency: 

>> Runtime for discovery module 'wireless': 0.1790 seconds with 142448 bytes
#### Unload disco module wireless ####


#### Load disco module fdb-table ####
BRIDGE-MIB: 
 : UUUUUU

>> Runtime for discovery module 'fdb-table': 0.9340 seconds with -1784 bytes
#### Unload disco module fdb-table ####

Discovered in 112.505 seconds

SNMP: Get[70/7.32s] Walk [51/89.41s]
MySQL: Cell[237/0.08s] Row[136/0.05s] Rows[77/0.03s] Column[1/0.00s] Update[87/0.06s] Insert[22/0.01s] Delete[1/0.00s]
LibreNMS Poller
Starting polling run:

Hostname: ROUTEROS.example.com
Device ID: 5
OS: routeros

Uptime: 1 day, 3h 10m 56s
Module [ unix-agent ] disabled globally.


#### Load poller module os ####
Hardware: HARDWARETYPE
Version: VERSIONNUMBER
Features: Level 6
Serial: SERIALNUMBER

>> Runtime for poller module 'os': 0.2948 seconds with 1008 bytes
#### Unload poller module os ####


#### Load poller module ipmi ####

>> Runtime for poller module 'ipmi': 0.0011 seconds with 1336 bytes
#### Unload poller module ipmi ####


#### Load poller module sensors ####
Checking (snmp) charge Battery charge remaining... 
HERE 100 END
100 
Checking (snmp) current Current... 
HERE 994 END
Checking (snmp) current sfp1 Tx... 
HERE 0 END
Checking (snmp) current sfp2 Tx... 
HERE 0 END
Checking (snmp) current sfp4 Tx... 
HERE 0 END
Checking (snmp) current sfp5 Tx... 
HERE 0 END
Checking (snmp) current sfp6 Tx... 
HERE 0 END
Checking (snmp) current sfp7 Tx... 
HERE 0 END
Checking (snmp) current sfp8 Tx... 
HERE 0 END
Checking (snmp) current sfp9 Tx... 
HERE 0 END
Checking (snmp) current sfp10 Tx... 
HERE 0 END
Checking (snmp) current Output... 
HERE  END
Checking (snmp) current Input... 
HERE  END
0.994 
0 
0 
0 
0 
0 
0 
0 
0 
0 
0 
0 
Checking (snmp) dbm sfp1 Tx... 
HERE 0 END
Checking (snmp) dbm sfp2 Tx... 
HERE 0 END
Checking (snmp) dbm sfp4 Tx... 
HERE 0 END
Checking (snmp) dbm sfp5 Tx... 
HERE 0 END
Checking (snmp) dbm sfp6 Tx... 
HERE 0 END
Checking (snmp) dbm sfp7 Tx... 
HERE 0 END
Checking (snmp) dbm sfp8 Tx... 
HERE 0 END
Checking (snmp) dbm sfp9 Tx... 
HERE 0 END
Checking (snmp) dbm sfp10 Tx... 
HERE 0 END
Checking (snmp) dbm sfp1 Rx... 
HERE 0 END
Checking (snmp) dbm sfp2 Rx... 
HERE 0 END
Checking (snmp) dbm sfp4 Rx... 
HERE 0 END
Checking (snmp) dbm sfp5 Rx... 
HERE 0 END
Checking (snmp) dbm sfp6 Rx... 
HERE 0 END
Checking (snmp) dbm sfp7 Rx... 
HERE 0 END
Checking (snmp) dbm sfp8 Rx... 
HERE 0 END
Checking (snmp) dbm sfp9 Rx... 
HERE 0 END
Checking (snmp) dbm sfp10 Rx... 
HERE 0 END
0 
0 
0 
0 
0 
0 
0 
0 
0 
0 
0 
0 
0 
0 
0 
0 
0 
0 
Checking (snmp) fanspeed fan 1... 
HERE 4082 END
4082 
Checking (snmp) frequency Input... 
HERE 0 END
0 
Checking (snmp) load Percentage load... 
HERE 17 END
17 
Checking (snmp) power Power Usage... 
HERE 238 END
23.8 
Checking (snmp) runtime Estimated battery time remaining... 
HERE 2696 END
2696 
Checking (snmp) state sfp1 Rx... 
HERE 0 END
Checking (snmp) state sfp2 Rx... 
HERE 0 END
Checking (snmp) state sfp4 Rx... 
HERE 0 END
Checking (snmp) state sfp5 Rx... 
HERE 0 END
Checking (snmp) state sfp6 Rx... 
HERE 0 END
Checking (snmp) state sfp7 Rx... 
HERE 0 END
Checking (snmp) state sfp8 Rx... 
HERE 0 END
Checking (snmp) state sfp9 Rx... 
HERE 0 END
Checking (snmp) state sfp10 Rx... 
HERE 0 END
Checking (snmp) state sfp1 Tx... 
HERE 0 END
Checking (snmp) state sfp2 Tx... 
HERE 0 END
Checking (snmp) state sfp4 Tx... 
HERE 0 END
Checking (snmp) state sfp5 Tx... 
HERE 0 END
Checking (snmp) state sfp6 Tx... 
HERE 0 END
Checking (snmp) state sfp7 Tx... 
HERE 0 END
Checking (snmp) state sfp8 Tx... 
HERE 0 END
Checking (snmp) state sfp9 Tx... 
HERE 0 END
Checking (snmp) state sfp10 Tx... 
HERE 0 END
Checking (snmp) state Battery Status... 
HERE 2 END
0 
0 
0 
0 
0 
0 
0 
0 
0 
0 
0 
0 
0 
0 
0 
0 
0 
0 
2 
Checking (snmp) temperature Temperature 0... 
HERE 320 END
Checking (snmp) temperature Processor Temperature 0... 
HERE 490 END
Checking (snmp) temperature sfp1... 
HERE 0 END
Checking (snmp) temperature sfp2... 
HERE 0 END
Checking (snmp) temperature sfp4... 
HERE 0 END
Checking (snmp) temperature sfp5... 
HERE 0 END
Checking (snmp) temperature sfp6... 
HERE 0 END
Checking (snmp) temperature sfp7... 
HERE 0 END
Checking (snmp) temperature sfp8... 
HERE 0 END
Checking (snmp) temperature sfp9... 
HERE 0 END
Checking (snmp) temperature sfp10... 
HERE 0 END
Checking (snmp) temperature Battery... 
HERE 0 END
32 
49 
0 
0 
0 
0 
0 
0 
0 
0 
0 
0 
Checking (snmp) voltage Voltage 0... 
HERE 234 END
Checking (snmp) voltage sfp1... 
HERE 0 END
Checking (snmp) voltage sfp2... 
HERE 0 END
Checking (snmp) voltage sfp4... 
HERE 0 END
Checking (snmp) voltage sfp5... 
HERE 0 END
Checking (snmp) voltage sfp6... 
HERE 0 END
Checking (snmp) voltage sfp7... 
HERE 0 END
Checking (snmp) voltage sfp8... 
HERE 0 END
Checking (snmp) voltage sfp9... 
HERE 0 END
Checking (snmp) voltage sfp10... 
HERE 0 END
Checking (snmp) voltage Battery... 
HERE 0 END
Checking (snmp) voltage Output... 
HERE 247 END
Checking (snmp) voltage Input... 
HERE 247 END
23.4 
0 
0 
0 
0 
0 
0 
0 
0 
0 
0 
247 
247 

>> Runtime for poller module 'sensors': 1.8786 seconds with 352 bytes
#### Unload poller module sensors ####


#### Load poller module processors ####
Processor Processor... 7%
Processor Processor... 19%
Processor Processor... 11%
Processor Processor... 0%
Processor Processor... 0%
Processor Processor... 0%
Processor Processor... 0%
Processor Processor... 3%
Processor Processor... 0%
Processor Processor... 0%
Processor Processor... 2%
Processor Processor... 0%
Processor Processor... 8%
Processor Processor... 5%
Processor Processor... 7%
Processor Processor... 5%

>> Runtime for poller module 'processors': 1.7957 seconds with 2648 bytes
#### Unload poller module processors ####


#### Load poller module mempools ####
Mempool main memory: 28.66% 

>> Runtime for poller module 'mempools': 4.2731 seconds with 9648 bytes
#### Unload poller module mempools ####


#### Load poller module storage ####
Storage system disk: hrstorage



43% 
Storage disk: SD: hrstorage



3% 
Storage disk: Portable SSD T3: hrstorage



1% 

>> Runtime for poller module 'storage': 2.8048 seconds with 2096 bytes
#### Unload poller module storage ####


#### Load poller module netstats ####
 IP TCP UDP ICMP SNMP IP-FORWARD

>> Runtime for poller module 'netstats': 0.6664 seconds with 12464 bytes
#### Unload poller module netstats ####


#### Load poller module hr-mib ####


>> Runtime for poller module 'hr-mib': 0.0919 seconds with 504 bytes
#### Unload poller module hr-mib ####


#### Load poller module ucd-mib ####

>> Runtime for poller module 'ucd-mib': 0.3126 seconds with 6960 bytes
#### Unload poller module ucd-mib ####


#### Load poller module ipSystemStats ####


>> Runtime for poller module 'ipSystemStats': 0.1593 seconds with 792 bytes
#### Unload poller module ipSystemStats ####


#### Load poller module ports ####
Caching Oids: ifDescr ifAdminStatus ifOperStatus ifLastChange ifType ifPhysAddress ifMtu ifInErrors ifOutErrors ifInDiscards ifOutDiscards dot3StatsDuplexStatusvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalidvalid
Port sfpplus1: sfpplus1 (1 / #33) VLAN == sfpplus1bps(0.000bps/0.000bps)bytes(0.000B/0.000B)pkts(0.000pps/0.000pps)
## TRUNCATED
## REDACTED


>> Runtime for poller module 'ports': 207.1401 seconds with 34552 bytes
#### Unload poller module ports ####


#### Load poller module bgp-peers ####

>> Runtime for poller module 'bgp-peers': 0.0014 seconds with 8344 bytes
#### Unload poller module bgp-peers ####

Module [ junose-atm-vp ] disabled globally.

Module [ toner ] disabled globally.


#### Load poller module ucd-diskio ####

>> Runtime for poller module 'ucd-diskio': 0.0003 seconds with 728 bytes
#### Unload poller module ucd-diskio ####

Module [ wifi ] disabled globally.


#### Load poller module wireless ####

>> Runtime for poller module 'wireless': 0.0025 seconds with 127600 bytes
#### Unload poller module wireless ####


#### Load poller module ospf ####
Processes:  Areas:  Ports:  Neighbours: 


>> Runtime for poller module 'ospf': 0.6872 seconds with 4648 bytes
#### Unload poller module ospf ####

Module [ cisco-ipsec-flow-monitor ] disabled globally.

Module [ cisco-remote-access-monitor ] disabled globally.

Module [ cisco-cef ] disabled globally.

Module [ cisco-sla ] disabled globally.

Module [ cisco-mac-accounting ] disabled globally.

Module [ cipsec-tunnels ] disabled globally.

Module [ cisco-ace-loadbalancer ] disabled globally.

Module [ cisco-ace-serverfarms ] disabled globally.

Module [ cisco-asa-firewall ] disabled globally.

Module [ cisco-voice ] disabled globally.

Module [ cisco-cbqos ] disabled globally.

Module [ cisco-otv ] disabled globally.

Module [ cisco-vpdn ] disabled globally.

Module [ netscaler-vsvr ] disabled globally.

Module [ aruba-controller ] disabled globally.


#### Load poller module entity-physical ####

>> Runtime for poller module 'entity-physical': 0.0008 seconds with 944 bytes
#### Unload poller module entity-physical ####


#### Load poller module applications ####


>> Runtime for poller module 'applications': 0.0912 seconds with 32840 bytes
#### Unload poller module applications ####

Module [ mib ] disabled globally.


#### Load poller module stp ####
.

>> Runtime for poller module 'stp': 0.4868 seconds with 3944 bytes
#### Unload poller module stp ####


#### Load poller module ntp ####

>> Runtime for poller module 'ntp': 0.0001 seconds with 192 bytes
#### Unload poller module ntp ####


#### Load poller module services ####

>> Runtime for poller module 'services': 0.0001 seconds with 0 bytes
#### Unload poller module services ####

Module [ loadbalancers ] disabled globally.

Module [ mef ] disabled globally.

Module [ tnms-nbi ] disabled globally.

uptime netstat_ip_forward Polled in 221.494 seconds
UPDATED!
#### Start Alerts ####
#### End Alerts ####
SNMP: Get[50/5.24s] Walk [25/215.46s]
MySQL: Cell[2/0.00s] Row[3/0.00s] Rows[33/0.02s] Column[3/0.00s] Update[286/0.20s] Insert[2/0.00s] Delete[0/0.00s]