Hello,
I’m just learning the basics of developing a plugin and have some questions after searching around.
- Is there better documentation ? Writing your own check plug-ins I’ve down followed the steps and have no idea how to get this to work as a service?
Would something like this be applicable?
-https://forum.checkmk.com/t/check-mk-english-snmp-checks/135942.
-
Is snmp plugins supposed to go “~/local/lib/check_mk/base/plugins/agent_based/” seems odd to put them in the “agent_based” as it’s not, but documentation only provides this path and seems to work.
-
Given the below plugin and output, can I get the output as
{[OID1] = [VALUE2],
[OID2] = [VALUE2]}
Is there something missing to get the OID information, so I can relate it to the values?
[VALUE1],
[VALUE2]
-
Is there examples I can follow? (perhaps on the git?) Please provide all the related files and paths, as to avoid just pointing to a group of “services” is not really going to help show what is related and applicable here.
-
Before you ask, I’m using public OIDs as it’s applicable to anyone trying to test this… The MIBs i’m going to use are custom, so sharing a more general example to get me started.
My progress so far:
~/local/lib/check_mk/base/plugins/agent_based/ANI.py
from cmk.base.plugins.agent_based.agent_based_api.v1 import *
def parse_sessions(string_table):
parsed = {}
print ("--", string_table, "--")
return parsed
register.snmp_section(
name = 'ANI',
detect = exists('.1.3.6.1.4.1.123.0'),
fetch = SNMPTree(
base = '.1.3.6.1',
oids = [
'4.1.2021.9.1', #DISK Monitoring
],
),
parse_function=parse_sessions,
)
Example Output:
Starting job...
-- [['1'], ['2'], ['3'], ['/pl2'], ['/data'], ['/statistics/partitions/internal'], ['/dev/vda1'], ['/dev/vda2'], ['/dev/vda2'], ['-1'], ['-1'], ['-1'], ['20'], ['10'], ['10'], ['5070464'], ['20575868'], ['20575868'], ['3488988'], ['20029132'], ['20029132'], ['1581476'], ['546736'], ['546736'], ['31'], ['3'], ['3'], ['0'], ['2'], ['2'], ['5070464'], ['20575868'], ['20575868'], ['0'], ['0'], ['0'], ['3488988'], ['20029132'], ['20029132'], ['0'], ['0'], ['0'], ['1581476'], ['546736'], ['546736'], ['0'], ['0'], ['0'], ['0'], ['0'], ['0'], [''], [''], ['']] --
Complete ...
I’m not sure how to “Group” the related /dev/vda1 volume with min / max etc … I would have thought they would be enumerated or OID Name / Value pairs?
Thank you in advance.
Mr.D