Hi Folks,
So I’m toying with the idea of moving all OS definitions from includes/definitions.inc.php
into individual json files such as includes/definitions/ios.json
. This would:
- Abstract config away from the codebase (making it less dependant on php).
- Reduce the size of definitions.inc.php and thus memory usage slightly.
- Help organise OS settings into one file, we can store test unit info, mibs + more.
I don’t expect it to be a big job initially as we can create the json files by just looping through $config['os']
and json_encode()
each one.
A few example files (based on the same os):
This would run includes/discovery/os/ios.inc.php and includes/poller/os/ios.inc.php still as it’s quite bespoke.
{
"os": "ios",
"group": "cisco",
"text": "Cisco IOS",
"type": "network",
"icon": "cisco",
"ifXmcbc": 1,
"over": [
{
"graph": "device_bits",
"text": "Device Traffic"
},
{
"graph": "device_processor",
"text": "CPU Usage"
},
{
"graph": "device_mempool",
"text": "Memory Usage"
}
],
"bad_ifXEntry": [
"cisco1941",
"cisco886Va"
],
"poller_modules":
{
"cisco-ace-serverfarms": 1,
"cisco-ace-loadbalancer": 1,
"cisco-cbqos": 1,
"cisco-cef": 1,
"cisco-mac-accounting": 1,
"cisco-voice": 1,
"cisco-remote-access-monitor": 1,
"cisco-sla": 1,
"cisco-ipsec-flow-monitor": 1,
"cipsec-tunnels": 1,
"cisco-otv": 1,
"ipmi": 0,
"toner": 0
},
"discovery_modules":
{
"toner": 0,
"cisco-cef": 1,
"cisco-sla": 1,
"cisco-mac-accounting": 1,
"cisco-otv": 1,
"cisco-pw": 1,
"cisco-vrf": 1,
"cisco-vrf-lite": 1
},
"discovery": {
"custom_discovery": true
},
"polling": {
"customer_poller": true
},
"register_mibs": {
"ciscoAAASessionMIB": "CISCO-AAA-SESSION-MIB"
}
}
This one would support detection directly in the MIB using OIDs
{
"os": "ios",
"group": "cisco",
"text": "Cisco IOS",
"type": "network",
"icon": "cisco",
"ifXmcbc": 1,
"over": [
{
"graph": "device_bits",
"text": "Device Traffic"
},
{
"graph": "device_processor",
"text": "CPU Usage"
},
{
"graph": "device_mempool",
"text": "Memory Usage"
}
],
"bad_ifXEntry": [
"cisco1941",
"cisco886Va"
],
"poller_modules":
{
"cisco-ace-serverfarms": 1,
"cisco-ace-loadbalancer": 1,
"cisco-cbqos": 1,
"cisco-cef": 1,
"cisco-mac-accounting": 1,
"cisco-voice": 1,
"cisco-remote-access-monitor": 1,
"cisco-sla": 1,
"cisco-ipsec-flow-monitor": 1,
"cipsec-tunnels": 1,
"cisco-otv": 1,
"ipmi": 0,
"toner": 0
},
"discovery_modules":
{
"toner": 0,
"cisco-cef": 1,
"cisco-sla": 1,
"cisco-mac-accounting": 1,
"cisco-otv": 1,
"cisco-pw": 1,
"cisco-vrf": 1,
"cisco-vrf-lite": 1
},
"discovery": {
"sysObjectId": {
"1.2.3.4.5.6.7",
"1.2.3.4.5.6.8",
}
},
"polling": {
"customer_poller": true
},
"register_mibs": {
"ciscoAAASessionMIB": "CISCO-AAA-SESSION-MIB"
}
}
This one would use sysName for OS detection and has a custom mib dir.
{
"os": "ios",
"group": "cisco",
"text": "Cisco IOS",
"type": "network",
"icon": "cisco",
"ifXmcbc": 1,
"over": [
{
"graph": "device_bits",
"text": "Device Traffic"
},
{
"graph": "device_processor",
"text": "CPU Usage"
},
{
"graph": "device_mempool",
"text": "Memory Usage"
}
],
"bad_ifXEntry": [
"cisco1941",
"cisco886Va"
],
"poller_modules":
{
"cisco-ace-serverfarms": 1,
"cisco-ace-loadbalancer": 1,
"cisco-cbqos": 1,
"cisco-cef": 1,
"cisco-mac-accounting": 1,
"cisco-voice": 1,
"cisco-remote-access-monitor": 1,
"cisco-sla": 1,
"cisco-ipsec-flow-monitor": 1,
"cipsec-tunnels": 1,
"cisco-otv": 1,
"ipmi": 0,
"toner": 0
},
"discovery_modules":
{
"toner": 0,
"cisco-cef": 1,
"cisco-sla": 1,
"cisco-mac-accounting": 1,
"cisco-otv": 1,
"cisco-pw": 1,
"cisco-vrf": 1,
"cisco-vrf-lite": 1
},
"discovery": {
"sysDescr": {
"Cisco IOS",
"IOS Device"
}
},
"polling": {
"customer_poller": true
},
"mib_dir": {
"cisco"
},
"register_mibs": {
"ciscoAAASessionMIB": "CISCO-AAA-SESSION-MIB"
}
}
What do people think about this? Does it look like it might make adding basic detection a bit easier? What is it missing?