SNMP - Plugin - Basics

Hi @Jiuka ,

Yes, just caught my mistake too. I had got that type of syntax from the examples but realized my mistake,

I’m still confused (and still trying) at the expected function “Service()” I was suspecting something like "Service (UniqueServiceLable, Name, Value) but not sure how to get the output into the formatting expected?

Code:

def discovery_ani_storage(section):
  for service in section.keys():
    print (service,section[service])
    # yield Service(item=service, name="size", value=section[Service]['Size'])
    yield Service(item=section[service])     ### <--

Current Output:

Starting job...
/dev/vda1  {'Size': '5070464', 'Used': '1576476'}
  WARNING: Exception in discovery function of check plugin 'ANI_Storage': 'item' must be a non empty string or ommited entirely, got {'Size': '5070464', 'Used': '1576476'}

Completed.