diff --git a/README.md b/README.md index 383525b..ab096e2 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,11 @@ [![Downloads](https://static.pepy.tech/personalized-badge/silverpeak-exporter?period=total&units=none&left_color=grey&right_color=orange&left_text=PyPI%20Downloads)](https://pepy.tech/project/silverpeak-exporter) # silverpeak-prometheus-exporter -Silverpeak/Aruba SD-WAN Prometheus Exporter, this tool is to query the Silverpeak/Aruba SD-WAN orchestrator export the metrics to a prometheus database. +Silverpeak/Aruba SD-WAN Prometheus Exporter, this tool is to query the Silverpeak/Aruba SD-WAN orchestrator export the metrics to a prometheus database. + +```diff +! For better security practices make sure the API key is read only. +``` ## Requierements diff --git a/docs/metrics.md b/docs/metrics.md index 2fac3ff..3c320b0 100644 --- a/docs/metrics.md +++ b/docs/metrics.md @@ -30,7 +30,10 @@ | orchPortalStatus| Enum | current connectivity status between Orchestrator and Cloud Portal | | cloudPortalServices| Gauge | silverpeak cloud portal service and status | | totalTunnelCount| Gauge | get total tunnel count across all appliances | - +| totalCPUs| Gauge | the total amount of CPU on the orchestrator, works only when orch is not running in container | +| loadAverage| Gauge | orchestrator load average, works only when orch is not running in container | +| totalMemSize| Gauge | total memory of the server, works only when orch is not running in container | +| maintenaceModeAppliances| Gauge | appliances currently in maintenance mode | ## Appliances System diff --git a/pyproject.toml b/pyproject.toml index b8b80ae..5952377 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "silverpeak_exporter" -version = "0.1.7" +version = "0.1.8" description = "Prometheus exporter for Silverpeak SD-WAN Appliances." authors = ["IP Headers "] license = "MIT" diff --git a/silverpeak_exporter/collectors.py b/silverpeak_exporter/collectors.py index aaca28d..ef386da 100644 --- a/silverpeak_exporter/collectors.py +++ b/silverpeak_exporter/collectors.py @@ -75,6 +75,12 @@ def _getOrchServerBrief(self): release.labels(orchName=self.hostname).info({'release' : orch_return['release']}) #Setting Metric platform.labels(orchName=self.hostname).info({'platform' : orch_return['platform']}) #Setting Metric numActiveUsers.labels(orchName=self.hostname).set(orch_return['numActiveUsers']) #Setting Metric + + if orch_return['platform'] != "DOCKER": + totalCPUs.labels(orchName=self.hostname).set(orch_return['numCpus']) #Setting Metric + loadAverage.labels(orchName=self.hostname).set(orch_return['loadAverage']) #Setting Metric + totalMemSize.labels(orchName=self.hostname).set(orch_return['memSize']) #Setting Metric + return orch_return @errorHandler @@ -173,6 +179,16 @@ def _getTotalTunnelCount(self): totalTunnelCount.labels(orchName=self.hostname).set(orch_return['totalTunnelCount']) return orch_return + @errorHandler + def _getAppliancesInMaintenance(self): + orch_return = self.orch.get_maintenance_mode_appliances() + supressAlarm = orch_return['suppressAlarm'] + supressOrch = orch_return['pauseOrchestration'] + + unique = supressAlarm + list(set(supressOrch) - set(supressAlarm)) + maintenaceModeAppliances.labels(orchName=self.hostname).set(len(unique)) + return orch_return + #--------------------------------------------------# # Metrics Collections for the Appliances #--------------------------------------------------# @@ -445,7 +461,7 @@ def __init__(self,url,ne_pk,applianceName,key,verify_ssl,interval,debug, Break): @errorHandler def _getApplianceFlows(self): - orch_return = self.orch.get_appliance_flows(self.ne_pk,uptime="term5m") + orch_return = self.orch.get_appliance_flows(self.ne_pk, uptime="term5m") activeTotalFlows.labels(applianceName=self.applianceName).set(orch_return['active']['total_flows']) #Setting Metric activeStaleFlows.labels(applianceName=self.applianceName).set(orch_return['active']['stale_flows']) #Setting Metric diff --git a/silverpeak_exporter/metrics.py b/silverpeak_exporter/metrics.py index d5909b7..8c96fc2 100644 --- a/silverpeak_exporter/metrics.py +++ b/silverpeak_exporter/metrics.py @@ -36,7 +36,10 @@ orchPortalStatus = Enum('orchPortalStatus', 'current connectivity status between Orchestrator and Cloud Portal',['orchName'], states=['unable to connect', 'connected', 'connecting']) cloudPortalServices = Gauge('cloudPortalServices', 'silverpeak cloud portal service and status',['orchName','portalService','status']) totalTunnelCount = Gauge('totalTunnelCount', 'get total tunnel count across all appliances',['orchName']) - +totalCPUs = Gauge('totalCPUs', 'the total amount of CPU on the orchestrator, works only when orch is not running in container',['orchName']) +loadAverage = Gauge('loadAverage', 'orchestrator load average, works only when orch is not running in container',['orchName']) +totalMemSize = Gauge('totalMemSize', 'total memory of the server, works only when orch is not running in container',['orchName']) +maintenaceModeAppliances = Gauge('maintenacModeAppliances', 'appliances currently in maintenance mode',['orchName']) #---------#---------#---------#---------#---------# # Appliance Metrics #---------#---------#---------#---------#---------#