cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 9

Custom SQL or SWQL Code Help

Hello I am trying to figure out a way to add a descriptor into my alerts that tells new staff whether an alert is for a PROD, or TEST, or UAT/DEV node.

Below is the basic concept of what I'm looking to add:

This alert is on a {variable} node.

if ${NodeName} contains pr than PROD

if ${NodeName} contains ts than TEST

if ${NodeName} does not contain pr or ts than DEV\UAT

Thanks in advance

Tags (2)
0 Kudos
7 Replies

Hi mnostrom my suggestion would be to use Custom Property Values. If you create a Node Custom Property called something such as Environment or Build_Level then populate that CP with the relevant value you will be able to insert that value in the Alert message with the Variable of ${N=SwisEntity;M=CustomProperties.Environment}

You could also set up an Alert that automatically assigns that Custom Property based on the Node Name if that is something your company adheres to in the naming policy.

To do that you would set up an Alert with the Trigger Condition of NodeName MUST Contain PR and the Trigger Action would be to set the custom property to PROD. (You would need an alert for each environment type ie PROD, TEST, UAT/DEV would be 3 Alerts).

- David Smith
0 Kudos

not all devices in SW adhere to the proper naming structure.

0 Kudos
MVP
MVP

You could create groups via dynamic queries and then use group member alerts.

Group_objects_and_mirror_network_dependencies_

https://support.solarwinds.com/Success_Center/Network_Performance_Monitor_(NPM)/How_to_create_a_Sola...

Groups can help you avoid some gnarly SQL joins.  Or at least hide the gnarly SQL.  When dynamically defined, they update/ maintain themselves based on matching the defined condition(s).  Note too that groups can be nested.

0 Kudos
Level 17

You can do this with the GUI Advanced Alert. There is an option for node name/caption 'Begins/Ends with' or 'Contains'

-CharlesH

Loop1 Systems: SolarWinds Training and Professional Services

0 Kudos

I do not find this Advanced Alert GUI you speak of...

0 Kudos

I want to make sure I understand what it is you are trying to do.

Can you explain, what are you alerting on?  We can either pull in the detail you want or build it out within the system so you can get the effect of;

if ${NodeName} contains pr than PROD

if ${NodeName} contains ts than TEST

if ${NodeName} does not contain pr or ts than DEV\UAT

It is hard to do this around the node name if there is no clear naming structure; so if "not all devices in SW adhere to the proper naming structure", then we will need to use Custom Properties or another way to label these devices. These can be set manually, or an automated element can be setup to put the CP details in place for you as dgsmith80​ mentioned.

Just a few more details and I am sure we can get you a clear way to divide and conquer these nodes and their alerts

0 Kudos

As long as there is some sort of unique identifier, maybe they are divided by IP Range or Subnet? Otherwise, it wouldn't take long to manually assign the CP to all your Nodes as you can update CP's in bulk.

- David Smith