DX NetOps

Expand all | Collapse all

Enable Maintenance mode by SNMP Trap

Jump to Best Answer
  • 1.  Enable Maintenance mode by SNMP Trap

    Posted 06-17-2015 08:54 AM

    Hi All,


    Can you please advise if you have ever had any success in enabling the maintenance mode by SNMP trap? I understand that the attribute can be toggled manually or its possible to define schedules but these do not really suit our requirements.


    I would like to enable and disable the device in maintenance mode by SNMP trap.


    Anyone had any success or knows a way to do it?




  • 2.  Re: Enable Maintenance mode by SNMP Trap

    Posted 06-19-2015 07:06 AM



    I have almost accomplished this using event procedures but having some difficulty with the second one (Remove from maintenance).


    Set Maintenance:

    0xfff05559 E 0 P WriteAttribute( {C CURRENT_MODEL}, {H 0x1295d}, {B FALSE} )


    Remove from Maintenance

    0xfff099b6 E 50 P "WriteAttribute(GetModelsByAttrValue( { S 0x1006e }, {S Server01}), { H 0x1295d }, { B TRUE } )"


    As you will see above, the plan is send a trap to any other device and bind the model name to one of the variable (I will then add that logic into the above procedure) but for now I have hardcoded it in the procedure. I am using the GetModelsByAttrValue procedure to lookup the model handle of the device which matches Model_name (0x1006e) with value "Server01". This for some reason does not seem to work, can you spot what I am doing wrong?



  • 3.  Re: Enable Maintenance mode by SNMP Trap

    Posted 06-17-2015 05:30 PM

    You can write an event procedure using the WriteAttribute() function and change the value of isManaged. The problem however is that once the

       device is in maintenance the isManaged and IsEventCreationEnabled both get set to False and the SpectroSERVER will not process any

       traps or events for the device.


    It might be possible to send the trap to an EventAdmin model passing the IP Address as the varbind and have a much more complicated Event

      Procedure to lookup the model handle of the target device and issue the WriteAttribute() function.


    Hopefully someone has done some work similar to this they could share?

  • 4.  Re: Enable Maintenance mode by SNMP Trap
    Best Answer

    Posted 06-19-2015 11:18 AM

    Although I have not used GetModelsByAttrValue myself, it seems to return a list. You can try using GetElement



    0xfff099b6 E 50 P "WriteAttribute(GetElement ( GetModelsByAttrValue( { H 0x1006e }, {S Server01}), { U 1 }), { H 0x1295d }, { B TRUE } )"

  • 5.  Re: Enable Maintenance mode by SNMP Trap

    Posted 06-18-2015 05:32 AM


    I wrote something like that :

    When i (Spectrum) receive a SNMP trap with Variable 4 equal to 33, 7 or 83, i turn on the maintenance on the devide.


    0x5f7008f E 0 P "If( Or( Equals( GetEventVariable( {U 4} ), {I 33} ), \

                     Or( Equals(GetEventVariable( {U 4} ), {I 7} ), \

                           Equals(GetEventVariable( {U 4} ), {I 83} )) ), \

                         WriteAttribute( {C CURRENT_MODEL}, {H 0x1295d}, {B FALSE} ), \

                      WriteAttribute( {C CURRENT_MODEL}, {H 0x1295d}, {B TRUE} ) )"





  • 6.  Re: Enable Maintenance mode by SNMP Trap

    Posted 06-18-2015 08:36 AM

    Hi Guys,


    Many thanks for the responses thus far, it seems like event procedure is certainly the way forward here. I can see how it is possible to enter the device into maintenance mode but removing it seems to be the biggest challenge.


    The part we are struggling with is how to lookup the model handle based on the IP address or model name. Does any know how to do that?




  • 7.  Re: Enable Maintenance mode by SNMP Trap

    Posted 06-19-2015 12:02 PM

    Hi Gregory,


    Thanks for your suggestion, I used the same logic which you have mentioned above and with a small tweak to get the value from an event variable I was able to achieve this.


    Many thanks for your continued help.



  • 8.  Re: Enable Maintenance mode by SNMP Trap

    Posted 06-18-2015 08:47 AM

    If you're planning to perform maintenance operations for a short period of time, you can consider Hibernation also. The difference between Maintenance is that the device is automatically pulled out of the Hibernation mode on 3 consecutive polls. This way you eliminate your biggest challenge, processing a trap from a device in maintenance mode.

  • 9.  Re: Enable Maintenance mode by SNMP Trap

    Posted 06-18-2015 08:52 AM

    Hi Catalin,


    Thanks for your response, unfortunately it will not be possible for us to use hibernation for this specific scenario as the device will remain online and traps will continue to be received for this model but they should be ignored. The reason we are doing this is the device will be upgraded and as such no traps should be acknowledged by spectrum during the upgrade as they may be false.


    Thanks again for your suggestion and I may find some use for it in the future.