Skip to content
Snippets Groups Projects
Commit 098670cb authored by Jenkins's avatar Jenkins
Browse files

Finished release 0.21.

parents 422f6b3f 314c2a34
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [0.21] - 2025-06-24
- Change check entity names to be static to prevent reaching sensu entity limit
## [0.20] - 2025-06-05 ## [0.20] - 2025-06-05
- Fix exception propagation and logging/exiting properly when exception occurs in the daemon thread (actually include the changes this time) - Fix exception propagation and logging/exiting properly when exception occurs in the daemon thread (actually include the changes this time)
......
...@@ -32,7 +32,8 @@ class EUMETSATMulticastHostCheck(sensu.AbstractCheck): ...@@ -32,7 +32,8 @@ class EUMETSATMulticastHostCheck(sensu.AbstractCheck):
@sensu.AbstractCheck.proxy_entity_name.getter @sensu.AbstractCheck.proxy_entity_name.getter
def proxy_entity_name(self): def proxy_entity_name(self):
return self.hostname # There's a 100 entity name limit in Sensu, so use a static string here
return 'EUMETSATMulticastHostCheck'
def refresh(sensu_params, subscriptions): def refresh(sensu_params, subscriptions):
......
...@@ -43,7 +43,8 @@ class GwSDirectInterfaceCheck(sensu.AbstractCheck): ...@@ -43,7 +43,8 @@ class GwSDirectInterfaceCheck(sensu.AbstractCheck):
@sensu.AbstractCheck.proxy_entity_name.getter @sensu.AbstractCheck.proxy_entity_name.getter
def proxy_entity_name(self): def proxy_entity_name(self):
return self.interface['hostname'] # There's a 100 entity name limit in Sensu, so use a static string here
return 'GwSDirectInterfaceCheck'
def refresh(sensu_params, inventory_interfaces): def refresh(sensu_params, inventory_interfaces):
......
...@@ -34,7 +34,8 @@ class DSCP32CountersCheck(sensu.AbstractCheck): ...@@ -34,7 +34,8 @@ class DSCP32CountersCheck(sensu.AbstractCheck):
@sensu.AbstractCheck.proxy_entity_name.getter @sensu.AbstractCheck.proxy_entity_name.getter
def proxy_entity_name(self): def proxy_entity_name(self):
return self.service['hostname'] # There's a 100 entity name limit in Sensu, so use a static string here
return 'DSCP32CountersCheck'
def refresh(sensu_params, services): def refresh(sensu_params, services):
......
...@@ -63,7 +63,8 @@ class SNMPInterfaceCheck(sensu.AbstractCheck): ...@@ -63,7 +63,8 @@ class SNMPInterfaceCheck(sensu.AbstractCheck):
@sensu.AbstractCheck.proxy_entity_name.getter @sensu.AbstractCheck.proxy_entity_name.getter
def proxy_entity_name(self): def proxy_entity_name(self):
return self.interface["router"] # There's a 100 entity name limit in Sensu, so use a static string here
return 'SNMPInterfaceCheck'
@staticmethod @staticmethod
def requires_snmp_check(interface): def requires_snmp_check(interface):
...@@ -101,7 +102,8 @@ class NetconfRouterCheck(sensu.AbstractCheck): ...@@ -101,7 +102,8 @@ class NetconfRouterCheck(sensu.AbstractCheck):
@sensu.AbstractCheck.proxy_entity_name.getter @sensu.AbstractCheck.proxy_entity_name.getter
def proxy_entity_name(self): def proxy_entity_name(self):
return self.router # There's a 100 entity name limit in Sensu, so use a static string here
return f"{self.vendor.upper()}NetconfRouterCheck"
def netconf_router_refresh(sensu_params, inventory_interfaces): def netconf_router_refresh(sensu_params, inventory_interfaces):
......
...@@ -2,7 +2,7 @@ from setuptools import setup, find_packages ...@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup( setup(
name='brian-polling-manager', name='brian-polling-manager',
version="0.20", version="0.21",
author='GEANT', author='GEANT',
author_email='swd@geant.org', author_email='swd@geant.org',
description='service for managing BRIAN polling checks', description='service for managing BRIAN polling checks',
......
...@@ -47,7 +47,7 @@ def test_router_check(config): ...@@ -47,7 +47,7 @@ def test_router_check(config):
"--config /var/lib/sensu/conf/get-interface-stats.config.json " "--config /var/lib/sensu/conf/get-interface-stats.config.json "
"--juniper xyz --all" "--juniper xyz --all"
) )
assert check["proxy_entity_name"] == "xyz" assert check["proxy_entity_name"] == "JUNIPERNetconfRouterCheck"
assert check["metadata"]["name"] == "rtr-xyz" assert check["metadata"]["name"] == "rtr-xyz"
assert check["output_metric_format"] == "" assert check["output_metric_format"] == ""
assert check["output_metric_handlers"] == [] assert check["output_metric_handlers"] == []
...@@ -62,7 +62,7 @@ def test_snmp_interface_check(config): ...@@ -62,7 +62,7 @@ def test_snmp_interface_check(config):
"/var/lib/sensu/bin/counter2influx-v6.sh counters 0pBiFbD bogus.router " "/var/lib/sensu/bin/counter2influx-v6.sh counters 0pBiFbD bogus.router "
"bogus/1/1 123" "bogus/1/1 123"
) )
assert check["proxy_entity_name"] == "bogus.router" assert check["proxy_entity_name"] == "SNMPInterfaceCheck"
assert check["metadata"]["name"] == "ifc-bogus.router-bogus-1-1" assert check["metadata"]["name"] == "ifc-bogus.router-bogus-1-1"
assert check["output_metric_format"] == "influxdb_line" assert check["output_metric_format"] == "influxdb_line"
assert check["output_metric_handlers"] == ["influx-db-handler"] assert check["output_metric_handlers"] == ["influx-db-handler"]
...@@ -86,7 +86,7 @@ def test_nokia_router_check(config): ...@@ -86,7 +86,7 @@ def test_nokia_router_check(config):
"--config /var/lib/sensu/conf/get-interface-stats.config.json " "--config /var/lib/sensu/conf/get-interface-stats.config.json "
"--nokia xyz --all" "--nokia xyz --all"
) )
assert check["proxy_entity_name"] == "xyz" assert check["proxy_entity_name"] == "NOKIANetconfRouterCheck"
assert check["metadata"]["name"] == "rtr-xyz" assert check["metadata"]["name"] == "rtr-xyz"
assert check["output_metric_format"] == "" assert check["output_metric_format"] == ""
assert check["output_metric_handlers"] == [] assert check["output_metric_handlers"] == []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment