Hi, I just now wrote a Check plugins according to the Document.
But i got the error by import the api module.
Traceback (most recent call last):
File “./Cisco_CMS.py”, line 3, in
from .agent_based_api.v1 import *
ImportError: attempted relative import with no known parent package
I tried with pip3 install agent_based_api, but it was not found.
How can I solve the problem?
Hi, thanks for your Tips.
I tried your Docus and changed my script according to it. But still the error.
aster@checkmk:/opt/omd/sites/pn/local/share/check_mk/checks$ ./Cisco_CMS.py
Traceback (most recent call last):
File “./Cisco_CMS.py”, line 24, in
check_info[“Cisco_CMS”] = {
NameError: name ‘check_info’ is not defined
My Skript is as below:
def inventory_cisco_cms(section):
for item, value in section:
yield Service(item=item)
def check_cisco_cms(section):
for item, value in section:
if item == ‘Voice’:
yield Metrik(name=item, value=value, levels=(300,400))
elif item == ‘Video’:
yield Metrik(name=item, value=value, levels=(70,140))
else:
yield Metrik(name=item, value=value)