diff --git a/src/contrib/collection/snmp/alcatel-isam-device-collection.json b/src/contrib/collection/snmp/alcatel-isam-device-collection.json new file mode 100644 index 000000000..33b0f53c3 --- /dev/null +++ b/src/contrib/collection/snmp/alcatel-isam-device-collection.json @@ -0,0 +1,178 @@ +{ + "mapping": { + "eqptSlotPowerStatus": { + "1": "powerUp", + "2": "powerDown" + }, + "eqptBoardAdminStatus": { + "1": "unlock", + "2": "lock" + }, + "eqptBoardOperStatus": { + "1": "operUp", + "2": "operDown" + }, + "eqptBoardOperError": { + "1": "no-error", + "2": "type-mismatch", + "3": "board-missing", + "4": "board-installation-missing", + "5": "no-planned-board", + "6": "waiting-for-sw", + "7": "init-boot-failed", + "8": "init-download-failed", + "9": "init-connection-failed", + "10": "init-configuration-failed", + "11": "board-reset-protection", + "12": "invalid-parameter", + "13": "temperature-alarm", + "14": "tempshutdown", + "15": "defense", + "16": "board-not-licensed", + "17": "sem-power-fail", + "18": "sem-ups-fail", + "19": "board-in-incompatible-slot", + "21": "download-ongoing", + "255": "unknown-error" + }, + "eqptBoardAvailStatus": { + "1": "available", + "2": "inTest", + "3": "failed", + "4": "powerOff", + "5": "notInstalled", + "6": "offLine", + "7": "dependency" + }, + "eqptBoardRestart": { + "1": "with-selftest", + "2": "without-selftest", + "5": "hot-restart", + "255": "initialValue" + }, + "eqptBoardLastRestartCause": { + "1": "poweron", + "2": "unknown", + "3": "watchdog", + "4": "coldreset", + "5": "warmreset", + "6": "hotreset", + "7": "hotreload", + "8": "cleandata", + "9": "emergencybuild", + "10": "poweronreset", + "11": "commitfailure", + "12": "timezonemodified" + } + }, + "constants": { + "criticalStatus": "operDown" + }, + "snmp": { + "tables": [ + { + "name": "eqptBoardEntry", + "oid": ".1.3.6.1.4.1.637.61.1.23.3.1", + "used_instance": "\\.(\\d+)$", + "entries" :[ + { "name": "eqptSlotPlannedType", "oid": ".1.3.6.1.4.1.637.61.1.23.3.1.2" }, + { "name": "eqptSlotActualType", "oid": ".1.3.6.1.4.1.637.61.1.23.3.1.3" }, + { "name": "eqptSlotPowerStatus", "oid": ".1.3.6.1.4.1.637.61.1.23.3.1.4", "map": "eqptSlotPowerStatus" }, + { "name": "eqptBoardAdminStatus", "oid": ".1.3.6.1.4.1.637.61.1.23.3.1.5", "map": "eqptBoardAdminStatus" }, + { "name": "eqptBoardOperStatus", "oid": ".1.3.6.1.4.1.637.61.1.23.3.1.6", "map": "eqptBoardOperStatus" }, + { "name": "eqptBoardOperError", "oid": ".1.3.6.1.4.1.637.61.1.23.3.1.7", "map": "eqptBoardOperError" }, + { "name": "eqptBoardAvailStatus", "oid": ".1.3.6.1.4.1.637.61.1.23.3.1.8", "map": "eqptBoardAvailStatus" }, + { "name": "eqptBoardRestart", "oid": ".1.3.6.1.4.1.637.61.1.23.3.1.9", "map": "eqptBoardRestart" }, + { "name": "eqptBoardContainerOffset", "oid": ".1.3.6.1.4.1.637.61.1.23.3.1.12" }, + { "name": "eqptBoardInventoryTypeName", "oid": ".1.3.6.1.4.1.637.61.1.23.3.1.14" }, + { "name": "eqptBoardInventoryPBACode", "oid": ".1.3.6.1.4.1.637.61.1.23.3.1.15" }, + { "name": "eqptBoardInventorySerialNumber", "oid": ".1.3.6.1.4.1.637.61.1.23.3.1.19" }, + { "name": "eqptBoardLastRestartCause", "oid": ".1.3.6.1.4.1.637.61.1.23.3.1.24", "map": "eqptBoardLastRestartCause" }, + { "name": "eqptBoardLastRestartTime", "oid": ".1.3.6.1.4.1.637.61.1.23.3.1.25" } + ] + } + ] + + }, + "selection": [ + { + "name": "operUp", + "functions": [ + { + "type": "count", + "src": "%(snmp.tables.eqptBoardEntry)", + "filter": "%(src.eqptBoardOperStatus) eq %(name)", + "save": "%(numOperUp)" + } + ], + "perfdatas": [ + { + "nlabel": "isam.device.%(name).count", + "value": "%(numOperUp)", + "min": 0 + + } + ], + "formatting": { + "printf_msg": "Number of %s device: %d", + "printf_var": [ + "%(name)", + "%(numOperUp)" + ], + "display_ok": false + } + }, + { + "name": "operDown", + "functions": [ + { + "type": "count", + "src": "%(snmp.tables.eqptBoardEntry)", + "filter": "%(src.eqptBoardOperStatus) eq %(name)", + "save": "%(numOperDown)" + } + ], + "perfdatas": [ + { + "nlabel": "isam.device.%(name).count", + "value": "%(numOperDown)", + "min": 0 + + } + ], + "formatting": { + "printf_msg": "Number of %s device: %d", + "printf_var": [ + "%(name)", + "%(numOperDown)" + ], + "display_ok": false + } + } + ], + "selection_loop": [ + { + "name": "eqptSlot ISAM", + "source": "%(snmp.tables.eqptBoardEntry)", + "expand_table": { + "eqptBoardEntry": "%(snmp.tables.eqptBoardEntry.[%(eqptBoardEntry.instance)])" + }, + "critical": "%(eqptBoardEntry.eqptBoardOperStatus) =~ /%(constants.criticalStatus)/", + "formatting": { + "printf_msg": "Card %s (slot%s): status is %s (%s), power status is %s", + "printf_var": [ + "%(eqptBoardEntry.eqptSlotActualType)", + "%(eqptBoardEntry.eqptBoardContainerOffset)", + "%(eqptBoardEntry.eqptBoardOperStatus)", + "%(eqptBoardEntry.eqptBoardOperError)", + "%(eqptBoardEntry.eqptSlotPowerStatus)" + ], + "display_ok": true + } + } + ], + "formatting": { + "custom_message_global": "All ISAM Boards are OK", + "separator": "-" + } +}