Hi,
I am wondering if this happened to any of you on Fortigate plugin on 2.1 version, below an example of the code.
Error on line 49
Others
Error in plugin file /omd/sites/prod/local/share/check_mk/checks/fortigate_ipsec: inconsistent use of tabs and spaces in indentation (, line 11)
Error in plugin file /omd/sites/prod/local/share/check_mk/checks/fortigate_memory: inconsistent use of tabs and spaces in indentation (, line 49)
Error in plugin file /omd/sites/prod/local/share/check_mk/checks/fortigate_sessions: inconsistent use of tabs and spaces in indentation (, line 36)
Error in plugin file /omd/sites/prod/local/share/check_mk/checks/fortigate_sslvpn: inconsistent use of tabs and spaces in indentation (, line 39)
Exchange plug in
https://exchange.checkmk.com/p/fortigate
def inventory_fortigate_memory(info):
if info:
return [(None, “fortigate_memory_default_levels”)]
def check_fortigate_memory(item, params, info):
warn, crit = params
try:
warn, crit = params
except:
warn, crit = params[“levels”]
if type(params) != dict:
warn, crit = params
else:
warn, crit = params[“levels”]
current = saveint(info[0][0])
state = 0
icon = ''
if current >= warn:
state = 1
icon = "(!!)"
if current >= crit:
state = 2
icon = "(!!)"
perf = [("mem_usage", current, warn, crit)]
return(state, "%d%%%s (levels at %d/%d percent)" % (current, icon, warn, crit), perf)
check_info[“fortigate_memory”] = {
“check_function” : check_fortigate_memory,
“inventory_function” : inventory_fortigate_memory,
“service_description” : “Memory usage”,
“has_perfdata” : True,
“group” : “memory”,
#“snmp_scan_function” : lambda oid: oid(“.1.3.6.1.4.1.12356.1.9.0”),
“snmp_scan_function” : lambda oid: oid(“.1.3.6.1.4.1.12356.101.4.1.4.0”),
#“snmp_info” : ( “.1.3.6.1.4.1.12356.1”, [ 9 ]),
“snmp_info” : ( “.1.3.6.1.4.1.12356.101.4.1”, [ 4 ]),
}