Subject: |
RE: threshold of high utilization exceeded: |
Author: |
Jane Curry |
Posted: |
2017-11-30 13:38 |
You might start by adding a line to the transform that reports on the speed. In that transform, between these lines:
# Extract the percent and utilization from the summary
import re
Try inserting:
evt.compSpeed =component.
speedMake sure it is at the same indent level. This should create a user-defined event field called compSpeed that you can see in the detail of the event. Just save that change - you don't need to stop or start anything. After saving, go back to the transform window and ensure that the code is not in red - if it is then there is a syntax error in your transform code.
Delete existing events for this and check a new one to see if the compSpeed attribute shows - and whether it is sensible / correct.
Cheers,
Jane
------------------------------
Jane Curry
Skills 1st United Kingdom
jane.curry@skills-1st.co.uk
------------------------------
Subject: |
RE: threshold of high utilization exceeded: |
Author: |
rop rop |
Posted: |
2017-12-22 06:22 |
Thanks for reply,
Unfortunately i wasn't able to make this tranfsorm working, but I have found another one, which is working well:
# Zenoss Transforms for Ethernet Interface Thresholds
# @davidstamen
# http://davidstamen.com
#SPEED10Mb = '100000000'
#SPEED100Mb = '100000000'
#SPEED1Gb = '1000000000'
#SPEED10Gb = '10000000000'
import re
fs_id = device.prepId(evt.component)
for f in device.os.interfaces():
if f.id != fs_id: continue
regex = re.search('threshold of .*(utilization).* (exceeded|restored|not met): current value ([\d\.]+)', evt.message, re.I)
if regex and device and device.getDeviceClassPath().startswith("/Network/Switch"):
EthernetInterface= re.search("current value ([\d\.]+)", evt.summary)
if EthernetInterface:
currentEthernetInterface = float(EthernetInterface.group(1)) * 8
evtKey = evt.eventKey
if f.speed == 0: continue
p = (currentEthernetInterface / f.speed) * 100
if "ifInOctets_ifInOctets|high utilization" in evtKey:
evtNewKey = "Input"
elif "ifHCInOctets_ifHCInOctets|high utilization" in evtKey:
evtNewKey = "Input"
elif "ifOutOctets_ifOutOctets|high utilization" in evtKey:
evtNewKey = "Output"
elif "ifHCOutOctets_ifHCOutOctets|high utilization" in evtKey:
evtNewKey = "Output"
else:
evtNewKey = "Unknown"
# Check the speed to determine the appropriate conversion
# Gbps utilization
if currentEthernetInterface > 1000000000:
Usage = currentEthernetInterface / 1000000000
evt.summary = "High Fiber Interface " + evtNewKey + " Utilization: Currently %3.2f%% used (%3.2f Gbps)" % (p, Usage)
evt.message = evt.summary
# Mbps utilization
elif currentEthernetInterface > 1000000:
Usage = currentEthernetInterface / 1000000
evt.summary = "High Fiber Interface " + evtNewKey + " Utilization: Currently %3.2f%% used (%3.2f Mbps)" % (p, Usage)
evt.message = evt.summary
# Kbps utilization
elif currentEthernetInterface > 1000:
Usage = currentEthernetInterface / 1000
evt.summary = "High Fiber Interface " + evtNewKey + " Utilization: Currently %3.2f%% used (%3.2f Kbps)" % (p, Usage)
evt.message = evt.summary
# bps utilization
elif currentEthernetInterface < 1000:
Usage = currentEthernetInterface
evt.summary = "High Fiber Interface " + evtNewKey + " Utilization: Currently %3.2f%% used (%3.2f bps)" % (p, Usage)
evt.message = evt.summary
Now in my event console i can see this:

and the question is: why TenGigabit interface yelling about utilization (which is low) and how can I deal with this?
Thanks in advance
rop