librenms / librenms

Community-based GPL-licensed network monitoring system
https://www.librenms.org
Other
3.92k stars 2.3k forks source link

Additional PANOS HA States needed #8924

Closed dev9null closed 6 years ago

dev9null commented 6 years ago

For the PANOS It would be good to include all the possible HA states in the includes/definitions/discovery/panos.yaml file.

The current HA modes (oid: panSysHAMode , num_oid: .1.3.6.1.4.1.25461.2.1.2.1.13. ) are complete with active-passive and active-active.

The panSysHAState and panSysHAPeerState is incomplete. In addition to active, passive, and suspended, the rest of the HA states for active-passive are

And the HA states for an active-active configuration are

This is from

librenms@librenms:~$ ./validate.php

Component Version
LibreNMS 1.41-42-g064ab1c
DB Schema 254
PHP 7.0.30-0ubuntu0.16.04.1
MySQL 10.0.34-MariaDB-0ubuntu0.16.04.1
RRDTool 1.5.5
SNMP NET-SNMP 5.7.3

====================================

[OK] Composer Version: 1.6.5 [OK] Dependencies up-to-date. [OK] Database connection successful [OK] Database schema correct

laf commented 6 years ago

Thanks for the bug report or new device request, unfortunately you have not provided the information asked for in point 3 when you created this issue.

Please provide pastebin links to the information we need and we will re-open this issue.

dev9null commented 6 years ago

There is no change needed to the OIDs in the panos.yaml file -- just additional states. Palo Alto Networks does not list the HA states in their MIB, but are nine states for the panSysHAState and panSysHAPeerState OIDs.

From a PAN OS box these are enumerated internally as:

ha.app.debug.state-set: enumeration: 0 'unknown' 1 'suspended' 2 'non-functional' 3 'initial' 4 'passive' 5 'active' 10 'tentative' 11 'active-secondary' 12 'active-primary'

The HA state is the string and it is the value retrieved via the panSysHAState and panSysHAPeerState.

If the LibreNMS discovery definition were to match the PAN OS internal enumeration, the panos.yaml file would look like this.

laf commented 6 years ago

Maybe not but we still need the data so we can produce test data.

dev9null commented 6 years ago

Will this work?

Setting the HA states manually to each possible state returns

for panSysHAState:

$ snmpget -v2c -c public -On 10.5.8.229 .1.3.6.1.4.1.25461.2.1.2.1.11.0
.1.3.6.1.4.1.25461.2.1.2.1.11.0 = STRING: "unknown"
$ 
$ snmpget -v2c -c public -On 10.5.8.229 .1.3.6.1.4.1.25461.2.1.2.1.11.0
.1.3.6.1.4.1.25461.2.1.2.1.11.0 = STRING: "suspended"
$ 
$ snmpget -v2c -c public -On 10.5.8.229 .1.3.6.1.4.1.25461.2.1.2.1.11.0
.1.3.6.1.4.1.25461.2.1.2.1.11.0 = STRING: "non-functional"
$ 
$ snmpget -v2c -c public -On 10.5.8.229 .1.3.6.1.4.1.25461.2.1.2.1.11.0
.1.3.6.1.4.1.25461.2.1.2.1.11.0 = STRING: "initial"
$ 
$ snmpget -v2c -c public -On 10.5.8.229 .1.3.6.1.4.1.25461.2.1.2.1.11.0
.1.3.6.1.4.1.25461.2.1.2.1.11.0 = STRING: "passive"
$ 
$ snmpget -v2c -c public -On 10.5.8.229 .1.3.6.1.4.1.25461.2.1.2.1.11.0
.1.3.6.1.4.1.25461.2.1.2.1.11.0 = STRING: "active"
$ 
$ snmpget -v2c -c public -On 10.5.8.229 .1.3.6.1.4.1.25461.2.1.2.1.11.0
.1.3.6.1.4.1.25461.2.1.2.1.11.0 = STRING: "tentative"
$ 
$ snmpget -v2c -c public -On 10.5.8.229 .1.3.6.1.4.1.25461.2.1.2.1.11.0
.1.3.6.1.4.1.25461.2.1.2.1.11.0 = STRING: "active-secondary"
$ 
$ snmpget -v2c -c public -On 10.5.8.229 .1.3.6.1.4.1.25461.2.1.2.1.11.0
.1.3.6.1.4.1.25461.2.1.2.1.11.0 = STRING: "active-primary"
$ 

and for panSysHAPeerState:

$ snmpget -v2c -c public -On 10.5.8.229 .1.3.6.1.4.1.25461.2.1.2.1.12.0
.1.3.6.1.4.1.25461.2.1.2.1.12.0 = STRING: "unknown"
$ 
$ snmpget -v2c -c public -On 10.5.8.229 .1.3.6.1.4.1.25461.2.1.2.1.12.0
.1.3.6.1.4.1.25461.2.1.2.1.12.0 = STRING: "suspended"
$ 
$ snmpget -v2c -c public -On 10.5.8.229 .1.3.6.1.4.1.25461.2.1.2.1.12.0
.1.3.6.1.4.1.25461.2.1.2.1.12.0 = STRING: "non-functional"
$ 
$ snmpget -v2c -c public -On 10.5.8.229 .1.3.6.1.4.1.25461.2.1.2.1.12.0
.1.3.6.1.4.1.25461.2.1.2.1.12.0 = STRING: "initial"
$ 
$ snmpget -v2c -c public -On 10.5.8.229 .1.3.6.1.4.1.25461.2.1.2.1.12.0
.1.3.6.1.4.1.25461.2.1.2.1.12.0 = STRING: "passive"
$ 
$ snmpget -v2c -c public -On 10.5.8.229 .1.3.6.1.4.1.25461.2.1.2.1.12.0
.1.3.6.1.4.1.25461.2.1.2.1.12.0 = STRING: "active"
$ 
$ snmpget -v2c -c public -On 10.5.8.229 .1.3.6.1.4.1.25461.2.1.2.1.12.0
.1.3.6.1.4.1.25461.2.1.2.1.12.0 = STRING: "tentative"
$ 
$ snmpget -v2c -c public -On 10.5.8.229 .1.3.6.1.4.1.25461.2.1.2.1.12.0
.1.3.6.1.4.1.25461.2.1.2.1.12.0 = STRING: "active-secondary"
$ 
$ snmpget -v2c -c public -On 10.5.8.229 .1.3.6.1.4.1.25461.2.1.2.1.12.0
.1.3.6.1.4.1.25461.2.1.2.1.12.0 = STRING: "active-primary"

Since the OIDs are just returning an internal string, the snmpwalk isn't very helpful.

dev9null commented 6 years ago

Verified on my local LibreNMS installation that this panos.yaml will correctly match the HA states returned by panSysHAState and panSysHAPeerState and graph the results.

laf commented 6 years ago

Feel free to submit that as a pull request but we will need test data for it.

dev9null commented 6 years ago

Sorry to be dense, but I'm struggling with what test data is necessary for this issue.

laf commented 6 years ago

https://docs.librenms.org/#Developing/os/Test-Units/#example-workflow