Re-visiting this one. Below is my check script. It is still only creating one service (for the first oid in the list .29);
#!/usr/bin/python
-- encoding: utf-8; py-indent-offset: 4 --
cisco_vpn_connections_default_values = (1000000, 2000000) #warn/crit
#.1.3.6.1.4.1.9.9.254.1.1.1.1.3.9 = Gauge32: 5025
def inventory_cisco_vpn_connections(checkname, info):
begin with empty inventory
inventory =
loop over all output lines of the agent
for line in info:
inv = (None, “cisco_vpn_connections_default_values” )
if inv not in inventory:
inventory.append(inv)
return inventory
def check_cisco_vpn_connections(item, params, info):
warn, crit = params
for line in info:
if len(line[0]) > 0:
count = int(line[0])
perfdata = [ ( “count”, count, warn, crit, 0 )]
if count > crit:
return (2, “%d connections (critical at %d)” % (count, crit), perfdata)
elif count > warn:
return (1, “%d connections (warning at %d)” % (count, warn), perfdata)
else:
return (0, “%d connections” % (count,), perfdata)
return (3, “Failed to parse agent data”)
check_info[“cisco_vpn_connections”] = \
(check_cisco_vpn_connections, “%s Connection Count”, 1, inventory_cisco_vpn_connections)
snmp_info[“cisco_vpn_connections”] = (‘.1.3.6.1.4.1.9.9.392.1.3’, [‘29’, ‘26’, ‘35’, ‘38’]),
Any pointers as to how I can have it create 4 services?
···
On Tue, Oct 14, 2014 at 8:07 PM, Paul - Monitoring paulmonitoring@gmail.com wrote:
Hi Marcel, I did. I have written snmp checks in the past, but provided a static service name. Since this check I want to write has multiple (oids) services, I’d prefer to use the object name as the service name rather than manually setting the service name. I’ll keep working on it,
On Oct 13, 2014, at 15:12, Marcel Schulte schulte.marcel@gmail.com wrote:
Hi Paul,
did you read the guide to write SNMP based checks (starting here:
http://mathias-kettner.de/checkmk_devel_snmpbased.html)? You can also
start by copying an existing check (e.g. hr_cpu).
HTH,
Marcel
2014-10-13 20:25 GMT+02:00 Paul Dott paulmonitoring@gmail.com:
Writing an snmp check here and struggling to get the services added, 4
OID’s are;
IPSec L2L
CISCO-REMOTE-ACCESS-MONITOR-MIB:crasL2LNumSessions
1.3.6.1.4.1.9.9.392.1.3.29
IPSec
CISCO-REMOTE-ACCESS-MONITOR-MIB:crasIPSecNumSessions
1.3.6.1.4.1.9.9.392.1.3.26
SSL VPN (AnyConnect)
CISCO-REMOTE-ACCESS-MONITOR-MIB:crasSVCNumSessions
1.3.6.1.4.1.9.9.392.1.3.35
WebVPN
CISCO-REMOTE-ACCESS-MONITOR-MIB:crasWebvpnNumSessions
1.3.6.1.4.1.9.9.392.1.3.38
When snmpwalking these OID’s the output looks like so;
.1.3.6.1.4.1.9.9.392.1.3.38.0 = Gauge32: 0.
Ideally i’d like to use the MIB as the unique service name, ie
crasWebvpnNumSessions.
Any guidance on the check scripting would be greatly appreciated.
checkmk-en mailing list
checkmk-en@lists.mathias-kettner.de
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en