diff --git a/agent_based/ospfv3_neighbor.py b/agent_based/ospfv3_neighbor.py index f349bade6a06eaa1606fa0f81a21a85ba12e45d0..60e96f58ad74c178055c16d664a6dd7e0652ca13 100644 --- a/agent_based/ospfv3_neighbor.py +++ b/agent_based/ospfv3_neighbor.py @@ -177,21 +177,21 @@ def check_ospfv3_neighbor(item, params, section: Dict[str, OspfV3Neighbor]) -> C # default monitoring states for ospfNbrState neighbor_states = { - '1': 2, # down - '2': 1, # attempt - '3': 1, # init - '4': 0, # twoWay - '5': 1, # exchangeStart - '6': 1, # exchange - '7': 1, # loading - '8': 0, # full + 1: 2, # down + 2: 1, # attempt + 3: 1, # init + 4: 0, # twoWay + 5: 1, # exchangeStart + 6: 1, # exchange + 7: 1, # loading + 8: 0, # full } + neighbor_states.update(params.get('neighbor_states', neighbor_states)) # update neighbor_states with params + yield Result(state=State.OK, summary=f'Neighbor ID: {neighbor.nbrRtrId}') # yield Result(state=State.OK, summary=f'On interface: {neighbor.nbrLocalInterface}') - neighbor_states.update(params.get('neighbor_states', neighbor_states)) # update neighbor_states with params - yield Result( state=State(neighbor_states.get(neighbor.nbrState, 3)), summary=f'Status: {ospf_nbr_state(neighbor.nbrState)}' @@ -247,6 +247,7 @@ register.check_plugin( discovery_function=discovery_ospfv3_neighbor, check_function=check_ospfv3_neighbor, check_default_parameters={ + 'state_not_found': 3, }, check_ruleset_name='ospfv3_neighbor', ) diff --git a/agent_based/ospfv3_virtuallink.py b/agent_based/ospfv3_virtuallink.py index 67552a1e6f58181a9344383c375db7a7fa7d7ffc..31eeb5d269e28e8f33d387f07fed1d529a25be9f 100644 --- a/agent_based/ospfv3_virtuallink.py +++ b/agent_based/ospfv3_virtuallink.py @@ -174,14 +174,14 @@ def check_ospfv3_virtuallink(item, params, section: Dict[str, OspfV3VirtualLink] # default monitoring states for ospfNbrState neighbor_states = { - '1': 2, # down - '2': 1, # attempt - '3': 1, # init - '4': 0, # twoWay - '5': 1, # exchangeStart - '6': 1, # exchange - '7': 1, # loading - '8': 0, # full + 1: 2, # down + 2: 1, # attempt + 3: 1, # init + 4: 0, # twoWay + 5: 1, # exchangeStart + 6: 1, # exchange + 7: 1, # loading + 8: 0, # full } neighbor_states.update(params.get('neighbor_states', neighbor_states)) # update neighbor_states with params @@ -246,6 +246,7 @@ register.check_plugin( discovery_function=discovery_ospfv3_virtuallink, check_function=check_ospfv3_virtuallink, check_default_parameters={ + 'state_not_found': 3, }, check_ruleset_name='ospfv3_virtuallink', ) diff --git a/ospfv3.mkp b/ospfv3.mkp index 393608f2346141acce3b4062c10ff7d2aac8eff7..2f8f5a9350f061d27179db5a65f7d885f222c253 100644 Binary files a/ospfv3.mkp and b/ospfv3.mkp differ