This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Unmanage or mute nodes Perl script for Linux

Revised 2018-04-09

Users here requested a Perl script that they could use to unmanage/remanage nodes from a cron job on Linux. This Perl script can unmanage, remanage, mute, or unmute a single node or all objects* in a group. If you run the script against a group, any sub-groups will also be affected.

*Unmanage/remanage will only work against Orion entities that are unmanageable. Some entities, such as Transaction Steps, are inherently un-unmanageable. Mute/unmute works with any Orion entity type.

The script, as provided, does not support wildcards or pattern matching. However, you can easily modify the queries in the script to support wildcards. It's up to you - I wanted to force users to be exact when modifying nodes and groups.

The -n / --notification option uses the recently-added Orion "mute alerts" capability. It no longer relies on a custom property, so it will work with any Orion object type.

Usage:

  setsolarwindsunmanaged_for_thwack.pl -S <webserver -H <hostname> [-m [-t <duration>]|[-D]] [-n [-D]] [-d]

  setsolarwindsunmanaged_for_thwack.pl -h

Solarwinds Unmanagement Script

Uses RESTful API to unmanage/remanage Solarwinds nodes

Parameters:

-S, --server         Solarwinds web server address (IP or DNS)

-H, --hostname       Name of the node (VM or server) that should be (un)managed or (un)notified.

-G, --group          Name of the group that should be (un)managed or (un)notified.

-t, --time           Duration of the unmanaged period in minutes (applies only to management)

-n, --notication     Enable or disable NOTIFICATIONS for the specified nodes

-m, --management     Enable or disable MANAGEMENT for the specified nodes

-D, --disable        DISABLE management/notifications for the specified nodes

-d, --debug          Enable debug mode

-h, --help           Show this message

Examples:

Turn off notification for a single node

  setsolarwindsunmanaged_for_thwack.pl -H 10.10.10.1 -S solarwinds-server.your-domain.com -n -D

Remanage a single node

  setsolarwindsunmanaged_for_thwack.pl -H some-server.your-domain.com -S solarwinds-server.your-domain.com -m

Unmanage a single node for the next hour

  setsolarwindsunmanaged_for_thwack.pl -H SOMESERVER -S solarwinds-server.your-domain.com -m -D 60

Unmanage every item (nodes, apps, subgroups, etc.) in a group for the next 5 minutes

  setsolarwindsunmanaged_for_thwack.pl -G SomeSolarwindsGroup -S solarwinds-server.your-domain.com -m -D -t 5

Turn on notifications for every item in a group

  setsolarwindsunmanaged_for_thwack.pl -G SomeSolarwindsGroup -S solarwinds-server.your-domain.com -n