Discussion:
Problem Installing Shane Scotts Device Search
Michael s
2011-10-10 09:46:04 UTC
Permalink
Michael s [http://community.zenoss.org/people/michael.s] created the discussion

"Re: Problem Installing Shane Scotts Device Search"

To view the discussion, visit: http://community.zenoss.org/message/61776#61776

--------------------------------------------------------------
isn't there anyone who can help? My Problem from post 9 still exists...
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/61776#61776]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Shane Scott
2011-10-19 00:57:10 UTC
Permalink
Shane Scott [http://community.zenoss.org/people/hackman238] created the discussion

"Re: Problem Installing Shane Scotts Device Search"

To view the discussion, visit: http://community.zenoss.org/message/61948#61948

--------------------------------------------------------------
Michael s:

I hope you're well! I've recently updated the pack to provide the needed functionality out of the box.

You can find it and documentation here: http://shanewilliamscott.com/Code/devicepropertysearch-zenpack.html http://shanewilliamscott.com/Code/devicepropertysearch-zenpack.html

Is your transform still give you grief?

Best,
--Shane W. Scott (Hackman238)
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/61948#61948]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Michael s
2011-11-14 11:08:27 UTC
Permalink
Michael s [http://community.zenoss.org/people/michael.s] created the discussion

"Re: Problem Installing Shane Scotts Device Search"

To view the discussion, visit: http://community.zenoss.org/message/62609#62609

--------------------------------------------------------------
Hello Shane,
the installation of your new modified Zenpack doesn't work. Even with your new version without version check(i just re-downloaded the *.egg file from your website...)
Here is the output in my console:

***@x:~$ zenpack --install=ZenPacks.ShaneScott.DeviceSearch-1.2.0-py2.6.egg
Not found: zenoss >= 3.2
2011-11-14 11:50:55,764 INFO zen.HookReportLoader: loading reports from:/usr/local/zenoss/zenoss/ZenPacks/ZenPacks.ShaneScott.DeviceSearch-1.2.0-py2.6.egg/ZenPacks/ShaneScott/DeviceSearch/reports

But i am using Zenoss  Version 3.2.1. What value is the installer checking for version check?


My current transform is exactly the one you've posted above:


import re



# test device object is not None

if device:

   # code for showing the 95th percentile in graphs

   fs_id = device.prepId(evt.component)

   for f in device.os.interfaces():

      if f.id != fs_id: continue



      # Extract the percent and utilization from the summary

      m = re.search("threshold of [^:]+: current value ([\d\.]+)", evt.message)

      if not m: continue

      currentusage = (float(m.groups()[0])) * 8

      p = (currentusage / f.speed) * 100

      evtKey = evt.eventKey



      # Whether Input or Output Traffic

      if evtKey == "ifInOctets_ifInOctets|high utilization":

          evtNewKey = "Input"

      elif evtKey == "ifOutOctets_ifOutOctets|high utilization":

          evtNewKey = "Output"





   # code to show correct units in events

      # Check the speed to determine the appropriate conversion

      # Gbps utilization

      if currentusage > 1000000000:

          Usage = currentusage / 1000000000

          evt.summary = "High " + evtNewKey + " Utilization: Currently (%3.2f Gbps) or %3.2f%% is being used." %  (Usage, p)

      # Mbps utilization

      elif currentusage > 1000000:

          Usage = currentusage / 1000000

          evt.summary = "High " + evtNewKey + " Utilization: Currently (%3.2f Mbps) or %3.2f%%  is being used." %  (Usage, p)

      # Kbps utilization

      elif currentusage > 1000:

          Usage = currentusage / 1000

          evt.summary = "High " + evtNewKey + " Utilization: Currently (%3.2f Kbps) or %3.2f%%  is being used." %  (Usage, p)

      # bps  utilization

      elif currentusage < 1000:

          Usage = currentusage

          evt.summary = "High " + evtNewKey + " Utilization: Currently (%3.2f bps) or %3.2f%%  is being used." %  (Usage, p)

      break



   # no generating of "High-Threshold"-Warnings for Tunnel-, Dialer- or Virtual-Access-Interfaces



   if evt.component.find("Tunnel") >= 0:

      evt._action = "drop"



   if evt.component.find("Dialer") >= 0:

      evt._action = "drop"



   if evt.component.find("Virtual-Access") >= 0:

      evt._action = "drop"



These transforms generate a warning in my event list:

Error processing transform/mapping on Event Class /


Also Tunnel-, Dialer and Virtual-Access interfaces are generating  "threshold of high utilization exeeded: current value xxxxx"-warnings. That means the Transform code you gave me works to install your ZenPack but does not drop the high threshold-warnings. Is there a way to get both things to work?

Greetz
Michael
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/62609#62609]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Shane Scott
2011-11-16 01:58:10 UTC
Permalink
Shane Scott [http://community.zenoss.org/people/hackman238] created the discussion

"Re: Problem Installing Shane Scotts Device Search"

To view the discussion, visit: http://community.zenoss.org/message/62625#62625

--------------------------------------------------------------
Michael:

I think f.speed is sometimes invalid and causing a problem.

Try this:

import re

# test device object is not None
if device:
   # code for showing the 95th percentile in graphs
   fs_id = device.prepId(evt.component)

   for f in device.os.interfaces():
      if f.id != fs_id: continue
      # Extract the percent and utilization from the summary
      m = re.search("threshold of [^:]+: current value ([\d\.]+)", evt.message)
      if not m: continue
      currentusage = (float(m.groups()[0])) * 8
      #computer percent using f.speed where f.speed != None, otherwise assume speed = 1
      speed = (f.speed or 1)
      p = (currentusage / int(speed)) * 100
      evtKey = evt.eventKey
      # Whether Input or Output Traffic
      if evtKey == "ifInOctets_ifInOctets|high utilization":
          evtNewKey = "Input"
      elif evtKey == "ifOutOctets_ifOutOctets|high utilization":
          evtNewKey = "Output"

   # code to show correct units in events
      # Check the speed to determine the appropriate conversion
      # check if speed > 1
      if speed > 1:
          # Gbps utilization
          if currentusage > 1000000000:
              Usage = currentusage / 1000000000
              evt.summary = "High " + evtNewKey + " Utilization: Currently (%3.2f Gbps) or %3.2f%% is being used." %  (Usage, p)
          # Mbps utilization
          elif currentusage > 1000000:
              Usage = currentusage / 1000000
              evt.summary = "High " + evtNewKey + " Utilization: Currently (%3.2f Mbps) or %3.2f%%  is being used." %  (Usage, p)
          # Kbps utilization
          elif currentusage > 1000:
              Usage = currentusage / 1000
              evt.summary = "High " + evtNewKey + " Utilization: Currently (%3.2f Kbps) or %3.2f%%  is being used." %  (Usage, p)
          # bps  utilization
          elif currentusage < 1000:
              Usage = currentusage
              evt.summary = "High " + evtNewKey + " Utilization: Currently (%3.2f bps) or %3.2f%%  is being used." %  (Usage, p)
          break
        else:
          # Gbps utilization
          if currentusage > 1000000000:
              Usage = currentusage / 1000000000
              evt.summary = "High " + evtNewKey + " Utilization: Currently (%3.2f Gbps is being used. Interface speed invalid" %  (Usage)
          # Mbps utilization
          elif currentusage > 1000000:
              Usage = currentusage / 1000000
              evt.summary = "High " + evtNewKey + " Utilization: Currently (%3.2f Mbps) is being used. Interface speed invalid" %  (Usage)
          # Kbps utilization
          elif currentusage > 1000:
              Usage = currentusage / 1000
              evt.summary = "High " + evtNewKey + " Utilization: Currently (%3.2f Kbps) is being used. Interface speed invalid" %  (Usage)
          # bps  utilization
          elif currentusage < 1000:
              Usage = currentusage
              evt.summary = "High " + evtNewKey + " Utilization: Currently (%3.2f bps) is being used. Interface speed invalid" %  (Usage)
          break

   # no generating of "High-Threshold"-Warnings for Tunnel-, Dialer- or Virtual-Access-Interfaces
   if evt.component.find("Tunnel") >= 0:
      evt._action = "drop"
   if evt.component.find("Dialer") >= 0:
      evt._action = "drop"
   if evt.component.find("Virtual-Access") >= 0:
      evt._action = "drop"
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/62625#62625]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Shane Scott
2011-11-16 02:03:17 UTC
Permalink
Shane Scott [http://community.zenoss.org/people/hackman238] created the discussion

"Re: Problem Installing Shane Scotts Device Search"

To view the discussion, visit: http://community.zenoss.org/message/62626#62626

--------------------------------------------------------------
Michael:

The DeviceSearch pack has been updated to fix the dependancy bug.

Best,
--Shane
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/62626#62626]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Loading...