SNMP Automation Script in Checkmk Raw Edition 2.1.0p18

Hi Team,

Is it possible to run a weekly automation script in checkmk where it will check whether the given servers are having SNMP or not and send us an email every week that so and so servers are with SNMP and so and so are not having SNMP…something like below

SNMP Data Report

*********auto generated mail *********

Hostname IP Address SNMP Data Status
SNMPv2-MIB::sysDescr.0 Success
SNMPv2-MIB::sysDescr.0 Success
SNMPv2-MIB::sysDescr.0 Success
Failed to retrieve SNMP data Failed

BR
//Prachi

Thinking out of the box to make this happen with RAW:

You can do a custom SNMP check, see:

Use a custom time period to have your custom SNMP check run a specific period once a week:

Use custom time period in a rule for Check period for active services

And then just collect the failure notification mails to make the report yourself.
Optionally you make a rule to send specific hosts / services to a non default mail address by making a rule in Setup | Events | Notification configuration so you can filter those mails away from the normal notificaitons.

Alternatively, not using notification mails at all, you can go for Business Intelligence instead to make a list of all the seperate services listed of the various servers. The result of BI kan be used as report instead. See:

Best to follow the BI example first and play around with it, if you haven’t done BI before.

2 Likes

Thank you so much !!!
Will try the solution this weekend…

Many thanks:)

BR
//Prachi

Hi,

Hope you are doing good, I am facing a strange problem!!
Our use case is simply to check wheather SNMP is present in bare metal server or not…
Now I have added a bare metal server which is having SNMP in it, now trying to add the bare metal server in checkmk with the below config


Now when I am running the test, only once it ran successfully, and now it’s simply giving timeouts !!!

BR
//Prachi

According to the docs:

Perhaps your device or network from Checkmk server to device is slow and can’t respond within default timing setting of 1 second. So you might need to add a rule Timing settings for SNMP access.

Hi,

Thank you for so quick response, read the documentation and increased the time interval… 2-3 times it worked on running the test and then again timeout. Also created the rule for increased SNMP timeout for an explicit host but didn’t work

Use case: This is a requirement to us from the asset management team to verify if checkmk can check the SNMP services on Bare metal and notify us if the SNMP service is failed on any of the bare metal servers (Gen9, Gen10). Is there any way to do this or make it happen?
if a timeout happens then we cant use checkmk for this…it should work uniformly…and there would be a huge number of bare metal servers on any of the networks in our organization…

Please suggest…

BR
//Prachi

I’m just a user of RAW like yourself. No experience with SNMP timeouts myself, so can’t suggest you much.

Searched forum for snmp timeout and found post How to increase SNMP timeout - currently stopping after approx 7 seconds - #6 by martin.schwarz where a blog article for SNMP debugging is linked:
Monitoring with SNMP: Troubleshooting in God Mode | Checkmk
Content of 2020 is a mix a various (old) versions, some are Enterprise specific, so possibly not all is applicable for you.

Hi,
No worries, thank you so much, buddy.
The interesting part is, I am able to solve the timeout issue by simply using the rule Bulk walk: Number of OIDs per bulk and have set the number of OID as 1 and so now we are getting the below output in test connections without timeouts.


Now the last bit is how can we get the OS detail which is in sysDescr to be reflected in the services of the BM host.
We are just concerned with the OS detail of the asset using SNMP.
We don’t want to run the test connection everytime to see the OS detail of the asset, it should be reflected in the services…Is there a way out?
Any idea !!!

Also have configured this rule “State and count of processes (only SNMP)”


After which the services reflected on the host are looking quite good, but the only thing we want is the OS details to be reflected on the services…

BR
//Prachi

You need to find the specific OID of sysDescr. If you go to the BM host in Checkmk, you can download the SNMP walk of the host.
image

Open download in your favourite editor, mine is Notepad++, and find the OID that gives the same output as sysDescr.

Then make a custom SNMP check with this OID as described here:

Example shows a custom SNMP check for my Kyocera printers, where I found the OID in de SNMP walk download.

EDIT: but perhaps you should disable your bulk walk rule first, before downloading SNMP walk. :wink:

1 Like

Hi Friend,

It worked flawlessly, I have removed the above 2 rules and only given Custom SNMP with OID. Perfectly getting the OS of the BM. Thank you !!!

Also in the host configuration of BM, removed the SNMP agent otherwise check_mk and Check_MKdiscovery are always critical…

BR
//Prachi

1 Like