Forum Discussion

David_Bond's avatar
David_Bond
Icon for Professor rankProfessor
2 years ago

Scripted Alert Thresholds

It should be possible to groovyscript Alert Thresholds, based on (for example) ILPs and hostProperties.

I need to modify the SNMP_Network_Interfaces to vary the InDiscardPercent threshold depending on whether this is a radioMAC interface type and whether it is a given customer.

Something along the lines of:

def isRadio = instanceProps.get('auto.interface.type') == 'radioMAC';

def customerCode = hostProps.get('customer.code');

if(isRadio && customerCode == 'ACME')

{

    // No threshold

    return '';

}

// The default

return '> 10';

  • @Stuart Weenig I’ll check to see what I can find out! 

    Also, in the near future we are planning to implement an idea board that would show the status of feature requests ;)

  • Anonymous's avatar
    Anonymous

    Also, if it’s possible, it would be nice to have the pre-request script built into the swagger.json file that can be imported into postman. That way, all you have to do is setup your environment and you’re ready to go. Currently, the environment is setup with the wrong auth type and the variable names differ from the setup instructions that have been used for a long time to setup postman. 

    https://community.logicmonitor.com/product-discussions-22/accessing-the-logicmonitor-rest-api-with-postman-and-lmv1-api-token-authentication-1703

    Now that LM is actually putting a little effort into the community, making this bit easier to onboard will go a long way towards building more trust between LM and the community.

  • mray's avatar
    mray
    Icon for LM Conqueror rankLM Conqueror

    This is all great feedback! I’ll address this in a feedback request internally. 

    @David Bond --  Like Stuart mentioned, you can import the swagger.json file into Postman, but the auth isn’t in line with LM’s auth. 

    I’m not sure about how much of this stuff is possible on the Postman/Swagger side, but I’ll note it all.

  • The way LM would tell you to do this is to tune those thresholds at the group level for each datapoint.  But you cannot create instance groups dynamically or do much with them even then (e.g., instance groups are not really groups, are not matchable in alert rules and you cannot tune thresholds for instance groups). Perhaps if they fixed those issues to work as you show, then the “normal” LM way would take care of it. Great idea!

    Exciting news from v187. Not multiple thresholds, but it’s progress.

    That is very good news!  I am shocked to see that under “Fixed Issues” as I am so often told things like this are feature requests (along with many issues I consider bug fixes). Regardless, will be nice to see this finally happen.  Wonder when instance groups will be selectable in Alert Rules….

  • Somewhere, I have a spreadsheet of Feature Requests that went into the black hole that is the “Feedback” button.

    I look forward to the data entry exercise of posting them into a public “Ideas Board” 😁

  • Anonymous's avatar
    Anonymous

    Me too. Up to 57 official requests.

  • A11ey's avatar
    A11ey
    Former Employee

    Well, 🤞🤞🤞, hoping we can import from PB, assuming they are already submitted.  I honestly have no idea the level of effort.  Assuming you have submitted these before?