Exported Alert: How to Populate Node Custom Properties Using Alerts
SolarWinds IP Address Manager (IPAM) module is a great tool to directly manage and monitor with rich visual presentation, the usage of IP addresses in a network. SolarWinds® provides multiple options to populate subnet information in our network to IPAM. Subnet information can be added manually, a spreadsheet can be imported, DHCP integration can be used to continually pull directly from DHCP servers and for the more adventurous or needy out there, via the Orion API.
As we can run different SolarWinds modules in a single platform; when we populate our subnets to IPAM and start monitoring IP addresses in our network, that IPAM scope also includes management IP addresses of our nodes that are currently monitored or will be monitored using Network Performance Monitor Server & Application Monitor modules. This is the starting point for our blog post; we can use subnet data in IPAM to enrich node information.
Let’s look at a standard subnet definition in SolarWinds; we must have Subnet Address and CIDR information in our subnet definition but at the same time, we can also customise other fields; description, location, subnet name, etc.
These fields can be used to enrich node custom properties and this approach can be automated using “Set Custom Property” action in alerts to update properties for newly populated nodes.
In order to demonstrate that feature, we have defined an alert to populate “Site” custom property of nodes based on “Location” attribute of IPAM subnets.
Requirements:
- IPAM subnets were defined with “Location” attribute value:
Alert Definition:
We defined a new alert as shown below, it is important to use less frequent evaluation time as we don’t need to check new devices every minute. Severity of the alert should also be selected as “Notice” or “Informational” as we are defining this alert for automation rather than the normal monitoring data analysis.
In “Trigger Condition” tab, we should select “Custom SQL Alert” in order to define SQL condition to correlated IPAM subnet dat with node information:
SQL Condition:
[code]INNER JOIN
(
SELECT DISTINCT ipaddress,
subnetid
FROM ipam_node) iplist ON nodes.ip_address=iplist.ipaddress INNER JOIN
(
SELECT groupid AS subnetid,
friendlyname AS subnetname,
location
FROM ipam_group
WHERE grouptype=8) subnets ON iplist.subnetid=subnets.subnetid WHERE nodes.site IS NULL[/code]
“Reset Condition” and “Time of Day” tabs can be skipped with default settings, as these are not relevant for our function:
In “Trigger Action” tab, we should add the “Change Custom Property” action type and we will utilise the advance ability for using a custom SQL query for “Site” custom property value:
FROM nodes
INNER JOIN
(
SELECT DISTINCT ipaddress,
subnetid
FROM ipam_node) iplist
ON nodes.ip_address=iplist.ipaddress
INNER JOIN
(
SELECT groupid AS subnetid,
friendlyname AS subnetname,
location
FROM ipam_group
WHERE grouptype=8) subnets
ON iplist.subnetid=subnets.subnetid
WHERE nodes.site IS NULL
AND nodes.nodeid=$
{N=SwisEntity; M=NodeID}}[/code]
“Reset Actions” tab can be skipped without adding any action and alert should be saved using “Submit” button on the last “Summary” tab. Once submitted, the alert will do it’s thing, pulling data from IPAM and inserting into the Custom Property data fields where we should see updated “Site” custom property values for nodes.
This is an example of using the Alerting capabilities to update data, which I hope you find useful. Please feel free to download the created Alert definition for importing into you installation. You will need to create the Custom Property structure or update the alert if your ‘site’ field is named differently.
Custom Alert: Auto Populate Custom Property Using Alert
Ecmel Ozdemir
Snr. SolarWinds Engineer
Custom Alert: Auto Populate Custom Property Using Alert
Related Insights From The Prosperon Blog
The Critical Role Of The Trusted Advisor In NetOps
Before there was “Network Operations” there were networks. Networks grew out of a need for connecting one box to another, sharing printers, and for more advanced users,...
Webinar On-Demand: Beyond Monitoring – Introducing SolarWinds Observability Platform
In this webinar, you will discover how SolarWinds® is evolving to deliver complete infrastructure visibility. This webinar examines how to extend visibility across your IT...
An Introduction To SolarWinds Orion’s Device Configuration Compliance Reporting
Needless to say, it is critical that the all network devices in your organisation are secure and available at all times. However, configuration changes and adding new...