Archived community.zenoss.org | full text search
Skip navigation
4665 Views 13 Replies Latest reply: Dec 2, 2011 10:49 AM by spawn!!! RSS
spawn!!! Rank: White Belt 36 posts since
Jan 26, 2011
Currently Being Moderated

Nov 24, 2011 11:20 AM

SNMP Polling on specific time.

Hi All,

 

I am wondering how to control by time frame of polling the snmp traffic from the devices. I am sure it is possible not sure about the correct way to do it.

 

I want to poll the snmp data during the specific time and during the rest, there should not be any SNMP activity.

 

Is there a way to control on device basis too??

 

Thanks in advance.

  • jmp242 ZenossMaster 4,060 posts since
    Mar 7, 2007
    Currently Being Moderated
    1. Nov 29, 2011 9:53 AM (in response to spawn!!!)
    Re: SNMP Polling on specific time.

    You probably will need to be more specific. Zenoss polls via SNMP every 60 seconds. The only time it stops polling a device is when it's marked decomissioned. You could, I suppose, either script going into and out of that state (as without polling you won't get much data to alert on anyway), or you could use command datasources or the like...

     

    --

    James Pulver

    ZCA Member

    LEPP Computer Group

    Cornell University

  • jmp242 ZenossMaster 4,060 posts since
    Mar 7, 2007
    Currently Being Moderated
    3. Nov 29, 2011 1:30 PM (in response to spawn!!!)
    Re: SNMP Polling on specific time.

    If you set a device to decomissioned, it's not monitored at all that I'm aware of. I don't have a script to do this however. You can also turn off zenmodeler and zenperfsnmp and any zenpack daemons (if you have them) that use SNMP to disable polling. I expect you may be able to do this with an event command, but I don't know how you'd turn them back on automatically if you're now not polling anything...

     

    Generally, people use templates to set polling options, (i.e. SNMP, WMI, SSH, ping etc) once... I don't actually know people who want Zenoss to regularily stop and then start monitoring specific devices, this is a new request to me...

     

    --

    James Pulver

    ZCA Member

    LEPP Computer Group

    Cornell University

  • Ryan Matte ZenossMaster 653 posts since
    Mar 26, 2009
    Currently Being Moderated
    4. Nov 29, 2011 1:54 PM (in response to spawn!!!)
    Re: SNMP Polling on specific time.

    You could write a python script and cron it to move devices in and out of a decomissioned state.  You don't even have to use the decomm state, you can create your own.  In settings you'll see a list of State conversions such as the following:

     

    Production:1000

    Pre-Production:500

    Test:400

    Maintenance:300

    Decommissioned:-1

    Standby:-2

    Spare:-3

     

    In this example list I've added two new states that behave like decommissioned states called Standby and Spare.

     

    Be aware that if you only collect data during certain periods then your averages for those devices in any reports will be off, since it will be missing half the data but will average the data out over the whole period.

  • Ryan Matte ZenossMaster 653 posts since
    Mar 26, 2009
    Currently Being Moderated
    5. Nov 29, 2011 1:52 PM (in response to spawn!!!)
    Re: SNMP Polling on specific time.

    Here's an example of what you would use for a script:

     

    #!/usr/bin/env python
    import Globals
    from Products.ZenUtils.ZenScriptBase import ZenScriptBase
    from transaction import commit
    
    dmd = ZenScriptBase(connect=True, noopts=True).dmd
    
    d = dmd.Devices.findDevice('yourdevice')
    
    for d in dmd.Devices.getSubDevices():
     if d.getDeviceName() == "yourdevice" or d.getDeviceName() == "anotherdevice":
      d.setProdState('-2')
    

     

    Where -2 is the ID of the Production State that you created.  The script needs to be executed as the zenoss user.

  • jmp242 ZenossMaster 4,060 posts since
    Mar 7, 2007
    Currently Being Moderated
    7. Nov 29, 2011 4:27 PM (in response to spawn!!!)
    Re: SNMP Polling on specific time.

    At this point, I have to recommend RTFM(s). It's going to be pretty necessary for you to understand basic Linux things like Cron to get very far with modifying / configuring Zenoss. Some tips about what you should know are in our New Users FAQ:

    https://zcaportal.org/wiki/bin/view/ZCA/ZCAFAQ#What_should_I_know_before_using_Zenoss_63

     

    Also, not to be a shill, but if you or others have more budget than time or interest in learning Zenoss and Linux, you may want to consider either an Enterprise Subscription or a Community Consulting engagement - the ZCA can help here as well.

    --

    James Pulver

    ZCA Member

    LEPP Computer Group

    Cornell University

  • j053ph4 Rank: Green Belt 290 posts since
    Dec 19, 2008
    Currently Being Moderated
    9. Dec 2, 2011 9:19 AM (in response to spawn!!!)
    Re: SNMP Polling on specific time.

    Is there a reason that a Maintenance Window wouldn't work for this?

     

    You could create a "Systems" or "Groups" organizer, add the maintenance window to the organizer, and then make the subset of devices a member of that organizer.  This is what I have done for situations like this and it works pretty well.  The "Decommissioned" state is one of the available options.

     

    Hope this helps,

     

    Joseph

  • Ryan Matte ZenossMaster 653 posts since
    Mar 26, 2009
    Currently Being Moderated
    10. Dec 2, 2011 10:23 AM (in response to j053ph4)
    Re: SNMP Polling on specific time.

    In my experience the use of maintenance windows is unreliable in terms of returning devices to their previous state once the window ends.  I've had lots of problems with them in the past so I've stopped using them.  Perhaps it's been resolved in more recent versions.

  • jmp242 ZenossMaster 4,060 posts since
    Mar 7, 2007
    Currently Being Moderated
    11. Dec 2, 2011 10:35 AM (in response to Ryan Matte)
    Re: SNMP Polling on specific time.

    Simple maintenance windows work fine - i.e. you have one computer go into maintenance and then come out. Overlapping ones don't work. It only stores state for one window per device.

     

    --

    James Pulver

    ZCA Member

    LEPP Computer Group

    Cornell University

  • Ryan Matte ZenossMaster 653 posts since
    Mar 26, 2009
    Currently Being Moderated
    12. Dec 2, 2011 10:40 AM (in response to jmp242)
    Re: SNMP Polling on specific time.

    Yeh, I was having issues with even single maintenance windows in the past.  I guess that was fixed.

More Like This

  • Retrieving data ...

Legend

  • Correct Answers - 4 points
  • Helpful Answers - 2 points