Skip to content

Commit

Permalink
run check plugins only with version 7.20A
Browse files Browse the repository at this point in the history
newer versions of the firmware do not offer the OIDs
  • Loading branch information
gurubert committed Nov 22, 2024
1 parent fa52968 commit fc9ee0d
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 22 deletions.
Binary file removed acgateway/acgateway-1.1.1.mkp
Binary file not shown.
Binary file added acgateway/acgateway-1.1.2.mkp
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.

from .agent_based_api.v1 import (
from cmk.base.plugins.agent_based.agent_based_api.v1 import (
all_of,
contains,
register,
render,
Metric,
OIDEnd,
Result,
Service,
SNMPTree,
State,
)

import datetime
import datetime # type: ignore

def _convert_date_and_time(octet_string):
return datetime.datetime(
Expand Down Expand Up @@ -77,7 +77,10 @@ def parse_acgateway_alarms(string_table):

register.snmp_section(
name="acgateway_alarms",
detect=contains(".1.3.6.1.2.1.1.2.0", ".1.3.6.1.4.1.5003.8.1.1"),
detect=all_of(
contains(".1.3.6.1.2.1.1.2.0", ".1.3.6.1.4.1.5003.8.1.1"),
contains(".1.3.6.1.2.1.1.1.0", "SW Version: 7.20A"),
),
parse_function=parse_acgateway_alarms,
fetch=[
SNMPTree(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# Boston, MA 02110-1301 USA.

from .agent_based_api.v1 import (
all_of,
contains,
get_rate,
get_value_store,
Expand All @@ -32,12 +33,7 @@

import time

from cmk.utils import debug
from pprint import pprint

def parse_acgateway_calls(string_table):
if debug.enabled():
pprint(string_table)
section = None
if len(string_table) == 1:
for active_calls, total_calls, asr, acd in string_table:
Expand All @@ -47,13 +43,14 @@ def parse_acgateway_calls(string_table):
'asr': int(asr),
'acd': int(acd),
}
if debug.enabled():
pprint(section)
return section

register.snmp_section(
name="acgateway_calls",
detect=contains(".1.3.6.1.2.1.1.2.0", ".1.3.6.1.4.1.5003.8.1.1"),
detect=all_of(
contains(".1.3.6.1.2.1.1.2.0", ".1.3.6.1.4.1.5003.8.1.1"),
contains(".1.3.6.1.2.1.1.1.0", "SW Version: 7.20A"),
),
parse_function=parse_acgateway_calls,
fetch=SNMPTree(
base='.1.3.6.1.4.1.5003.10.8.2',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# Boston, MA 02110-1301 USA.

from .agent_based_api.v1 import (
all_of,
contains,
register,
render,
Expand Down Expand Up @@ -55,7 +56,10 @@ def parse_acgateway_ipgroup(string_table):

register.snmp_section(
name="acgateway_ipgroup",
detect=contains(".1.3.6.1.2.1.1.2.0", ".1.3.6.1.4.1.5003.8.1.1"),
detect=all_of(
contains(".1.3.6.1.2.1.1.2.0", ".1.3.6.1.4.1.5003.8.1.1"),
contains(".1.3.6.1.2.1.1.1.0", "SW Version: 7.20A"),
),
parse_function=parse_acgateway_ipgroup,
fetch=SNMPTree(
base='.1.3.6.1.4.1.5003.9.10.3.1.1.23.21.1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# Boston, MA 02110-1301 USA.

from .agent_based_api.v1 import (
all_of,
contains,
register,
render,
Expand Down Expand Up @@ -99,7 +100,10 @@ def parse_acgateway_sipinterface(string_table):

register.snmp_section(
name="acgateway_sipinterface",
detect=contains(".1.3.6.1.2.1.1.2.0", ".1.3.6.1.4.1.5003.8.1.1"),
detect=all_of(
contains(".1.3.6.1.2.1.1.2.0", ".1.3.6.1.4.1.5003.8.1.1"),
contains(".1.3.6.1.2.1.1.1.0", "SW Version: 7.20A"),
),
parse_function=parse_acgateway_sipinterface,
fetch=[
SNMPTree(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# Boston, MA 02110-1301 USA.

from cmk.base.plugins.agent_based.agent_based_api.v1 import (
all_of,
contains,
get_rate,
get_value_store,
Expand All @@ -35,7 +36,10 @@ def parse_acgateway_sipperf(string_table):

register.snmp_section(
name="acgateway_sipperf",
detect=contains(".1.3.6.1.2.1.1.2.0", ".1.3.6.1.4.1.5003.8.1.1"),
detect=all_of(
contains(".1.3.6.1.2.1.1.2.0", ".1.3.6.1.4.1.5003.8.1.1"),
contains(".1.3.6.1.2.1.1.1.0", "SW Version: 7.20A"),
),
parse_function=parse_acgateway_sipperf,
fetch=[
SNMPTree(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,19 @@
# Boston, MA 02110-1301 USA.

from cmk.base.plugins.agent_based.agent_based_api.v1 import (
all_of,
contains,
get_rate,
get_value_store,
register,
render,
Metric,
OIDEnd,
Result,
Service,
SNMPTree,
State,
)

import time

from cmk.utils import debug
from pprint import pprint
from pprint import pprint #type: ignore

def parse_acgateway_users(string_table):
if debug.enabled():
Expand All @@ -52,7 +48,10 @@ def parse_acgateway_users(string_table):

register.snmp_section(
name="acgateway_users",
detect=contains(".1.3.6.1.2.1.1.2.0", ".1.3.6.1.4.1.5003.8.1.1"),
detect=all_of(
contains(".1.3.6.1.2.1.1.2.0", ".1.3.6.1.4.1.5003.8.1.1"),
contains(".1.3.6.1.2.1.1.1.0", "SW Version: 7.20A"),
),
parse_function=parse_acgateway_users,
fetch=SNMPTree(
base='.1.3.6.1.4.1.5003.10.8.2',
Expand Down

0 comments on commit fc9ee0d

Please sign in to comment.