Custom Plugin is not discovering services over WATO, only over site's console with commands

CMK version: 2.0.0p12
OS version: CentOS Linux release 7.9.2009
Hi community!!

We developed a custom plugin for getting some snmp counters for fortinet devices, we checked it on console and it works (see attached pictures).


https://exchange.checkmk.com/p/check-sla-fortinet

But when we try to do this discovery over WATO it doesn’t get information about this section. We have enabled this section over: Disabled or enabled sections (SNMP) and over Fetch intervals for SNMP sections.
imagen

For getting this plugin working we have to follow next steps on check_mk console:

check_mk -v --snmpwalk HOSTNAME 
cmk --debug -II --detect-plugins=sla_fortinet HOSTNAME
cmk -nvp HOSTNAME
cmk -O && cmk -R

if we discover services on this way we get then monitored.

Is there any step we’re missing?? Maybe something is wrong with de plugin we developed?

Thanks for any help and time.

If your check is only found with the option “–detect-plugins=sla_fortinet” then we have a problem in the “snmp_scan_function” of your check.
With this option you say “don’t use the scan function, discover this check”, but inside the web interface the discovery only uses the scan function.
All the other parts of the check are ok i think, as there is no error on execution.

2 Likes

Hi andreas!! Thanks for your reply.

I have no idea how to define that snmp_scan_function, is something related with this section?

register.snmp_section(
	name = "sla_fortinet",
	detect = exists(".1.3.6.1.4.1.12356.101.4.9.2.1"),
	fetch = SNMPTree(
	        base = '.1.3.6.1.4.1.12356.101.4.9.2.1',
		oids = [
			"14", #LinkName
			"4", #LinkState
			"5", #LinkLatency
			"9", #LinkPacketLoss
		],
	),
	parse_function=parse_Sla,
)

Checking documentation I’ve found what you told me about snmp_scan_function: Monitoring via SNMP - Monitoring of SNMP devices with Checkmk but still have no idea how to implement it. Do you have any example or documentation about how set this?

Again, thanks for your help and time.

Yes this is the right section. In 2.0 it is named “detect” not “scan_function”.
I would first check what is the content of the OID “.1.3.6.1.2.1.1.2.0” and then i would write a “contains” instead of the used “exists”. Exists should also work but your check for the OID of a table then the exists should end with a “.*”.

detect = exists(".1.3.6.1.4.1.12356.101.4.9.2.1.*"),

Alternative like this here.

detect = contains(".1.3.6.1.2.1.1.2.0", ".1.3.6.1.4.1......."),

or

detect = startswith(".1.3.6.1.2.1.1.2.0", ".1.3.6.1.4.1........"),
1 Like

Thanks a lot Andreas!! It fix the trouble!!! :blush:

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.