添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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.

I used to do this type of checks in python using the snimpy library.

I think it simplifies a lot all the work!

Of course you need to create the legacy check rule!

Hope it will be helpful.

Nicolas.

On Behalf Of Paul Dott

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.

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).

Marcel

2014-10-13 20:25 GMT+02:00 Paul Dott <[email protected]>:

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
[email protected]
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en

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 <[email protected]> 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).

Marcel

2014-10-13 20:25 GMT+02:00 Paul Dott <[email protected]>:

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
[email protected]
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-en

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 [email protected] 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 [email protected] 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).

Marcel

2014-10-13 20:25 GMT+02:00 Paul Dott [email protected] :

Writing an snmp check here and struggling to get the services added, 4

Hi Paul,

as long as you want to get more than one service you cannot use None as item in inventory function - items must be unique.

Could you post a snmp walk of your device at .1.3.6.1.4.1.9.9.392.1.3?

What exactly do you expect or want to get as result? Can you explain it with your snmpwalk?

Regards,

Marcel

On Tue, Oct 14, 2014 at 8:07 PM, Paul - Monitoring [email protected] 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 [email protected] 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).

Marcel

2014-10-13 20:25 GMT+02:00 Paul Dott [email protected] :

Writing an snmp check here and struggling to get the services added, 4

I want to use this one check script to output 4 seperate services.(.29, .26, .35, .38)

1.3.6.1.4.1.9.9.392.1.3.29

SNMPv2-SMI::enterprises.9.9.392.1.3.29.0 = Gauge32: 0

1.3.6.1.4.1.9.9.392.1.3.26

SNMPv2-SMI::enterprises.9.9.392.1.3.26.0 = Gauge32: 0

1.3.6.1.4.1.9.9.392.1.3.35

SNMPv2-SMI::enterprises.9.9.392.1.3.35.0 = Gauge32: 28

1.3.6.1.4.1.9.9.392.1.3.38

SNMPv2-SMI::enterprises.9.9.392.1.3.38.0 = Gauge32: 0

Although, not that I look at the output, there is no unique service description that is provided. So I may have to hardcode those?

Here are the service descriptions I would use for the 4 OID’s;

crasL2LNumSessions
1.3.6.1.4.1.9.9.392.1.3.29

crasIPSecNumSessions
13.6.1.4.1.9.9.392.1.3.26

crasSVCNumSessions
1.3.6.1.4.1.9.9.392.1.3.35

crasWebvpnNumSessions
1.3.6.1.4.1.9.9.392.1.3.38

On Tue, May 26, 2015 at 12:35 PM, Marcel Schulte [email protected] wrote:

Hi Paul,

as long as you want to get more than one service you cannot use None as item in inventory function - items must be unique.

Could you post a snmp walk of your device at .1.3.6.1.4.1.9.9.392.1.3?

What exactly do you expect or want to get as result? Can you explain it with your snmpwalk?

Regards,

Marcel

On Tue, Oct 14, 2014 at 8:07 PM, Paul - Monitoring [email protected] 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 [email protected] 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).

Marcel

2014-10-13 20:25 GMT+02:00 Paul Dott [email protected] :

Writing an snmp check here and struggling to get the services added, 4

Hi Paul,

normally one would create one service with four values in that case - or a checktype with 4 subchecks.

In the first case you would have a check like yours but inventory would only return one service and check function would return all four values formatted in service detail. In second case all would be kept in one check(file) but all four values would get “their own” subcheck: inventory function and check function. snmp_info would be the same for all subchecks.

If needed I could try to find some spare time tomorrow and rewrite your checkfile for either case.

Regards,

Marcel

On Tue, May 26, 2015 at 12:35 PM, Marcel Schulte [email protected] wrote:

Hi Paul,

as long as you want to get more than one service you cannot use None as item in inventory function - items must be unique.

Could you post a snmp walk of your device at .1.3.6.1.4.1.9.9.392.1.3?

What exactly do you expect or want to get as result? Can you explain it with your snmpwalk?

Regards,

Marcel

On Tue, Oct 14, 2014 at 8:07 PM, Paul - Monitoring [email protected] 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 [email protected] 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).

Marcel

2014-10-13 20:25 GMT+02:00 Paul Dott [email protected] :

Writing an snmp check here and struggling to get the services added, 4

OK thanks. I like the idea of 4 separate checks.That way it would be easier to manage thresholds and other such things.

On Tue, May 26, 2015 at 2:21 PM, Marcel Schulte [email protected] wrote:

Hi Paul,

normally one would create one service with four values in that case - or a checktype with 4 subchecks.

In the first case you would have a check like yours but inventory would only return one service and check function would return all four values formatted in service detail. In second case all would be kept in one check(file) but all four values would get “their own” subcheck: inventory function and check function. snmp_info would be the same for all subchecks.

If needed I could try to find some spare time tomorrow and rewrite your checkfile for either case.

Regards,

Marcel

Paul D [email protected] schrieb am Di., 26. Mai 2015 um 19:57 Uhr:

I want to use this one check script to output 4 seperate services.(.29, .26, .35, .38)

Hi Paul,

as long as you want to get more than one service you cannot use None as item in inventory function - items must be unique.

Could you post a snmp walk of your device at .1.3.6.1.4.1.9.9.392.1.3?

What exactly do you expect or want to get as result? Can you explain it with your snmpwalk?

Regards,

Marcel

On Tue, Oct 14, 2014 at 8:07 PM, Paul - Monitoring [email protected] 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 [email protected] 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).

Marcel

2014-10-13 20:25 GMT+02:00 Paul Dott [email protected] :

Writing an snmp check here and struggling to get the services added, 4