Hi r.sander, thank you for the fast reaction!
I have changed it but there is no result still the same otput.
About the csv file - I have to add after the service name a customer name which is taken from other system. That’s why I am reading a csv file. How can I do that in other way?
#!/usr/bin/env python
edge_router_default_bw_values = (1.0, 2.0, 3.0)
def inventory_check_vpls(info):
for index,name,description,adminStatus,peerCount in info:
try:
newName=name+" - " + Services[name]
yield newName,"edge_router_default_bw_values"
except:
yield name, "edge_router_default_bw_values"
def check_vpls(item, params, info):
import csv
Services={}
with open('/opt/omd/sites/epsmon/SOF.csv', mode='r') as infile:
reader = csv.reader(infile)
for row in reader:
serviceName=row[33]
customerName=row[10]
Services.update({serviceName:customerName})
bad,ok,worse = paramsi
for index,name,description,adminStatus,peerCount in info:
if item==name or name in item:
print (name, peerCount)
try:
customerName=Services[name]
except:
customerName=""
if "1"=="1":
if int(peerCount)!=0:
return 0,"VPLS Instance is UP, Description: %s, CUSTOMER: %s"%(description,customerName)
else:
return 2,"VPLS Instance is DOWN - %s"%(customerName)
check_info["check_vpls"] = {
"check_function" : check_vpls,
"inventory_function" : inventory_check_vpls,
"service_description" : "VPLS : %s",
"snmp_info" : ( ".1.3.6.1.4.1.2636.5.8.1", [ "2.1.1","2.1.2","2.1.3","2.1.4","3.1.2" ] ),
"has_perfdata" : False,
"group" : "vpls",
}
And about the second one which is not showing at all do you have any ideas?
P.S - I couldn’t find a good documentation for the SNMP checks does anyone have one or some tutorials?
Thank you!