Compare commits
2 Commits
8896c6914c
...
109654ba77
Author | SHA1 | Date | |
---|---|---|---|
109654ba77 | |||
ba6cb1371e |
@ -79,7 +79,7 @@ class MonitoringPluginScript(MonitoringPlugin):
|
|||||||
# Check that the load average is greater or equal to the cpu count
|
# Check that the load average is greater or equal to the cpu count
|
||||||
if load_average > float(cpu_cores):
|
if load_average > float(cpu_cores):
|
||||||
# Set the health delta to 10 (subtract 10 from the total of 100)
|
# Set the health delta to 10 (subtract 10 from the total of 100)
|
||||||
health_delta = 10
|
health_delta = 50
|
||||||
# Craft a message that can be used by the clients
|
# Craft a message that can be used by the clients
|
||||||
message = f"Current load is {load_average} out of {cpu_cores} CPU cores"
|
message = f"Current load is {load_average} out of {cpu_cores} CPU cores"
|
||||||
|
|
||||||
|
@ -46,10 +46,6 @@ from pvcnoded.objects.MonitoringInstance import MonitoringPlugin
|
|||||||
# the file name
|
# the file name
|
||||||
PLUGIN_NAME = "nics"
|
PLUGIN_NAME = "nics"
|
||||||
|
|
||||||
# Set a minimum link speed variable used below
|
|
||||||
# For PVC at least 10 Gbps is required for proper operation of a cluster
|
|
||||||
MINIMUM_LINKSPEED = 10000
|
|
||||||
|
|
||||||
|
|
||||||
# The MonitoringPluginScript class must be named as such, and extend MonitoringPlugin.
|
# The MonitoringPluginScript class must be named as such, and extend MonitoringPlugin.
|
||||||
class MonitoringPluginScript(MonitoringPlugin):
|
class MonitoringPluginScript(MonitoringPlugin):
|
||||||
@ -172,7 +168,7 @@ class MonitoringPluginScript(MonitoringPlugin):
|
|||||||
|
|
||||||
max_supported_link_speed = sorted(list(supported_link_speeds))[-1]
|
max_supported_link_speed = sorted(list(supported_link_speeds))[-1]
|
||||||
|
|
||||||
# Ensure interface is running at MINIMUM_LINKSPEED
|
# Ensure interface is running at its maximum speed
|
||||||
with open(f"/sys/class/net/{dev}/speed") as devfh:
|
with open(f"/sys/class/net/{dev}/speed") as devfh:
|
||||||
dev_speed = int(devfh.read())
|
dev_speed = int(devfh.read())
|
||||||
if dev_speed < max_supported_link_speed:
|
if dev_speed < max_supported_link_speed:
|
||||||
|
Reference in New Issue
Block a user