Skip to content

Commit

Permalink
Enh collection zxtm pool (#4634)
Browse files Browse the repository at this point in the history
  • Loading branch information
DalfoCentreon authored Jan 19, 2024
1 parent 6e93836 commit e856a05
Show file tree
Hide file tree
Showing 2 changed files with 148 additions and 0 deletions.
84 changes: 84 additions & 0 deletions src/contrib/collection/snmp/zxtm-pool.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"constants": {
"okState": "active",
"criticalState": "disabled",
"criticalConnSecond": null,
"criticalCurrConn": null
},
"mapping": {
"poolState": {
"1": "active",
"2": "disabled",
"3": "draining",
"4": "unused",
"5": "unknown"
}
},
"snmp": {
"tables": [
{
"name": "poolEntry",
"oid": ".1.3.6.1.4.1.7146.1.2.3.2.1",
"used_instance": "\\.1\\.3\\.6\\.1\\.4\\.1\\.7146\\.1\\.2\\.3\\.2\\.1\\.\\d+\\.(\\d+(\\.\\d+)+)",
"entries": [
{
"name": "poolName",
"oid": ".1.3.6.1.4.1.7146.1.2.3.2.1.1"
},
{
"name": "poolState",
"oid": ".1.3.6.1.4.1.7146.1.2.3.2.1.14",
"map": "poolState"
},
{
"name": "poolTotalConn",
"oid": ".1.3.6.1.4.1.7146.1.2.3.2.1.10",
"sampling": 1
},
{
"name": "poolCurrentConn",
"oid": ".1.3.6.1.4.1.7146.1.2.3.2.1.48"
}
]
}
]
},
"selection_loop": [
{
"name": "Pool ZXTM",
"source": "%(snmp.tables.poolEntry)",
"expand_table": {
"poolEntry": "%(snmp.tables.poolEntry.[%(poolEntry.instance)])"
},
"critical": "%(poolEntry.poolState) =~ /%(constants.criticalState)/ or (defined(%(constants.criticalConnSecond)) and %(poolEntry.poolTotalConnPerSeconds) >= %(constants.criticalConnSecond)) or (defined(%(constants.criticalCurrConn)) and %(poolEntry.poolCurrentConn) >= %(constants.criticalCurrConn))",
"perfdatas": [
{
"nlabel": "connS",
"instances": ["%(poolEntry.poolName)"],
"value": "%(poolEntry.poolTotalConnPerSeconds)",
"critical": "%(constants.criticalConnSecond)",
"unit": "conn/s",
"min": 0
},
{
"nlabel": "conn",
"instances": ["%(poolEntry.poolName)"],
"value": "%(poolEntry.poolCurrentConn)",
"critical": "%(constants.criticalConn)",
"unit": "conn",
"min": 0
}
],
"formatting": {
"printf_msg": "Device '%s' state is '%s', current connetions are '%d', with conn/s '%.2f'",
"printf_var": [
"%(poolEntry.poolName)",
"%(poolEntry.poolState)",
"%(poolEntry.poolCurrentConn)",
"%(poolEntry.poolTotalConnPerSeconds)"
],
"display_ok": true
}
}
]
}
64 changes: 64 additions & 0 deletions src/contrib/collection/snmp/zxtm-virtualserver.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"constants": {
"criticalCurrConn": null
},
"mapping": {
},
"snmp": {
"tables": [
{
"name": "virtualserverEntry",
"oid": ".1.3.6.1.4.1.7146.1.2.2.2.1",
"used_instance": "\\.1\\.3\\.6\\.1\\.4\\.1\\.7146\\.1\\.2\\.2\\.2\\.1\\.\\d+\\.(\\d+(\\.\\d+)+)",
"entries": [
{
"name": "virtualserverName",
"oid": ".1.3.6.1.4.1.7146.1.2.2.2.1.1"
},
{
"name": "virtualserverCurrentConn",
"oid": ".1.3.6.1.4.1.7146.1.2.2.2.1.9"
},
{
"name": "virtualServerMaxConnections",
"oid": ".1.3.6.1.4.1.7146.1.2.2.2.1.10"
},
{
"name": "virtualserverTotalHTTPRequests",
"oid": ".1.3.6.1.4.1.7146.1.2.2.2.1.43"
}
]
}
]
},
"selection_loop": [
{
"name": "Virtual Server ZXTM",
"source": "%(snmp.tables.virtualserverEntry)",
"expand_table": {
"virtualserverEntry": "%(snmp.tables.virtualserverEntry.[%(virtualserverEntry.instance)])"
},
"critical": "defined(%(constants.criticalCurrConn)) and %(virtualserverEntry.virtualserverCurrentConn) >= %(constants.criticalCurrConn)",
"perfdatas": [
{
"nlabel": "conn",
"instances": ["%(virtualserverEntry.virtualserverName)"],
"value": "%(virtualserverEntry.virtualserverCurrentConn)",
"critical": "%(constants.criticalConn)",
"unit": "conn",
"min": 0
}
],
"formatting": {
"printf_msg": "Device '%s' current connections are '%d', max connections are '%d', total HTTP requests are '%d'",
"printf_var": [
"%(virtualserverEntry.virtualserverName)",
"%(virtualserverEntry.virtualserverCurrentConn)",
"%(virtualserverEntry.virtualServerMaxConnections)",
"%(virtualserverEntry.virtualserverTotalHTTPRequests)"
],
"display_ok": true
}
}
]
}

0 comments on commit e856a05

Please sign in to comment.