Name

nnmscheduledoutage.ovpl — Command line tool used to schedule an outage for node(s).

SYNOPSIS

nnmscheduledoutage.ovpl -u <user> -p <password> [-?]
-create (-node <NODE>| -nodeGroup <NODEGROUP>| -file <FILE) <TIME-SPEC> -name <NAME> [ -description <DESCRIPTION>] [-retroactive]
-delete (-name <NAME> [-node <NODE>]) | -uuid <UUID>
-list [-v] [-node <NODE> | -uuid <UUID> ] [-format <FORMAT>]
-dump [-node <NODE>] [<TIME-SPEC>] [-retroactive] [-format <FORMAT>]
-update (-name <NAME> [-NODE <NODE>] | -uuid <UUID>) (<TIME-SPEC> | -addNode <NODE> | -removeNode <NODE>)
<TIME-SPEC> ::= -start <TIME> (-duration <DURATION> | -end <TIME>) [-tz <TIMEZONE>]

DESCRIPTION

nnmscheduledoutage.ovpl is a command line tool used to create scheduled outages for nodes. During the scheduled outage time frame, the nodes within the outage are moved to a Management Mode of Out of Service and moved back to Managed once the outage time frame has passed. Nodes may be grouped into outages individually, by node group or added via text file. Outages may be deleted by outage name, by node within the outage or by the UUID of the outage. Outages can be listed verbosely by any participating node to the screen, or formatted into various formats such as CSV. An outage may be updated to add or remove additional nodes or to change the time specification of the outage.

Parameters

nnmscheduledoutage.ovpl supports the following options:

-?

Prints the usage statement.

-u <username>

Supply the NNMi administrator username to run the script. This script requires the NNMi administrator username unless you use an nnm.properties file. See the nnm.properties.4 reference page for more information.

-p <password>

Supply the NNMi administrator password to run the script. This script requires the NNMi administrator password unless you use an nnm.properties file. See the nnm.properties.4 reference page for more information.

-addNode <NODE>

This is used when updating an outage, to add a node to the specified outage.

-create

Create a new scheduled outage for the specified system(s).

-delete

Delete the specified scheduled outage.

-description

Provide additional descriptive notes to the outage.

-duration <DURATION>

duration of the outage, in minutes. This can also be specified with a number followed by "m: for minutes (the default if "m" is omitted), "h" for hours or "d" for days, e.g. "3h" is a 3 hour outage.

-end <TIME>

The end time of the outage. See formatting rules below for syntax. The "-retroactive" flag is required if the end time is prior to the current time.

-file <FILE>

The name of a text file that contains a list of nodes to associate with the outage. The file can contain blank lines, comments beginning with "#" character, remaining lines are considered nodes. The nodes can be specified as either hostnames, IP addresses, or the node UUID. If a hostname or IP address is not unique, then an error is generated, since the outage cannot determine which node applies.

-format <FORMAT>

Format to list the output, currently only 'csv' or 'xml' is available.

-nodeGroup <NODEGROUP>

Node group name.

-list

List scheduled outage information for the specified system, or list all outages if no system specified. With the verbose flag, detailed information is printed including affected nodes. Listing by UUID always provides the detailed information for the outage specified.

-dump

Lists node outage history with start time and end time. Note that outage history includes any time that the node(s) moved from MANAGED state to either UNMANAGED or OUTOFSERVICE (which would be the start time) and then back to MANAGED (the end time). Any nodes which are currently in the UNMANAGED or OUTOFSERVICE state will be marked as having an end time of the current time. The output of this command can be used as input to the iSPI Performance server (NPS) so that NPS can adjust database records associated with nodes that were offline during specific time windows.

When the -retroactive option is specified only outages which were retroactively created are output.

When given a node parameter, it dumps outages for the specified node.

When given a time specification, it dumps outages that completed in that time window. The time specification must include a start time, and can optionally include duration or end time. Without a duration or end time the meaning is essentially "dump all outages since start time". Time windows are inclusive for the start time and exclusive for the end time.

Note that either node or start time must be specified. If both are specified, then outages are listed for for the specified node, in the time window.

-name <NAME>

Name of the scheduled outage. The name is semi-unique in that outages can be referred to by name. However outage names do not have to be unique, and two outages with the same name can be further specified by listing a node that is included in the desired outage.

-node <NODE>

Node name, hostname, management address or UUID.

-retroactive

Create an outage in the past, retroactively. This is used to create an outage entry in the database, for some past outage that had occurred without being scheduled beforehand.

-removeNode <NODE>

Remove a node from the specified outage.

-start <TIME>

Start time for the outage (see formatting rules).

-tz <TIMEZONE>

Timezone specification (see formatting rules)

-update

Update the specified scheduled outage. The timing of the outage can be updated, as well as the included nodes.

-uuid

UUID of the scheduled outage.

FORMATTING RULES

Start time and end time are specified as YYYY-MM-DDTHH:MM, for example 2013-05-08T14:56 is May 8th, 2013, at 2:56PM. Start and end time can also be specified as "now", to begin an outage immediately, or to end an outage currently in progress.

As mentioned above, duration can be a number (in minutes), or a number followed by "m", "h", or "d", for minutes, hours, and days, respectively. Case is ignored, so "1d" is the same as "1D".

The timezone parameter can be any valid Java timezone parameter, for example "US/Mountain" or "Australia/Perth". The timezone parameter can also be "target" (case ignored), which means that the time of the outage is specified in the timezone as the target node(s). If "target" is specified, then all nodes must be in the same timezone. Note also that "target" also requires that the nodes have had a timezone attribute attached. The timezone could also be specified as "server", meaning to use the timezone of the NNMi server, which might be different than the timezone of the user's shell process. If no timezone is specified, then the timezone of the user's shell process is used.

Note: When creating an outage, you must specify the start time, and either the end time or the duration (but not both).

Note: The minimum outage duration is 15 minutes, any outage less than that is rejected. This also applies to ending an outage "now", if the start time was less than 15 minutes prior.

EXAMPLES

Create a scheduled outage, lasting 1 day, for a node using the timezone of the node (assuming May 21, 2013 is a future date):

nnmscheduledoutage.ovpl create -node cisco6509 -start 2013-05-21T09:00 -tz TARGET -duration 1d -name "Replace power supply"

Same as above, but retroactively (assuming May 21, 2013 was in the past, instead of future in the previous example):

nnmscheduledoutage.ovpl create -node cisco6509 -retroactive -start 2013-05-21T09:00 -tz TARGET -duration 1d -name "Replace power supply" -retroactive

Create a scheduled outage for a node using a local start and end time

nnmscheduledoutage.ovpl create -node cisco6509 -start 2013-05-21T10:00 -end 2013-05-21T14:00 -name "Replace power supply"

Scheduling in a specified timezone

nnmscheduledoutage.ovpl create -node cisco6509 -start 2013-05-21T09:00 -end 2013-05-21T10:00 -tz Australia/Perth -name "Replace power supply"

Schedule an outage for a list of nodes which are listed in the file "nodes.txt"

nnmscheduledoutage.ovpl create -file nodes.txt -start 2013-05-21T09:00 -tz TARGET -duration 1d -name "Weekly Maintenance" 

Schedule an outage in a specified timezone by duration. The node group UUID is used in this example.

nnmscheduledoutage.ovpl create -nodeGroup 75f95c1a-0ee0-49ac-a815-c32ab74b1449 -start 2013-05-25T09:00 -end 2013-05-25T11:00 -tz Australia/Perth -name "Weekly Router Maintenance"

List outages for the specified node. The UUID, Name, Start Time, End Time and Duration of the outage(s) are displayed in a table.

nnmscheduledoutage.ovpl list -node cisco6509 

List outages in CSV format

nnmscheduledoutage.ovpl list -node cisco6509 -format csv

Dump node outage history in CSV format, for all outages since July 1st 2013

nnmscheduledoutage.ovpl dump -node cisco6509 -format csv -start 2013-07-01T00:00

Dump all retroactive outages for December 2013 in CSV format

nnmscheduledoutage.ovpl dump -retroactive -start 2013-12-01T00:00 -end 2014-01-01T00:00 -format CSV

Delete an outage by name. If multiple outages have the same name, then they are all deleted.

nnmscheduledoutage.ovpl delete -name "Weekly Router Maintenance" 

Delete an outage by outage UUID, which is unique, so only the specified outage is deleted.

nnmscheduledoutage.ovpl delete -uuid 204846c0-a35b-4a92-9726-4ce0a8be596d

Extend an outage by name with new outage end date

nnmscheduledoutage.ovpl update -name "Weekly Router Maintenance" -end 2013-05-21T12:00 

Extend an outage by outage UUID by providing a new duration (relative to the scheduled start time)

nnmscheduledoutage.ovpl update -uuid 204846c0-a35b-4a92-9726-4ce0a8be596d -duration 2h

Delay a scheduled outage by target and name with a new start time (but keeping the same end time)

nnmscheduledoutage.ovpl update -node cisco6509 -name "Replace power supply" -start 2013-05-21T08:00 

AUTHOR

nnmscheduledoutage.ovpl was developed by Hewlett Packard Enterprise.

FILES

$NNM_BIN/nnmscheduledoutage.ovpl

SEE ALSO

Return to Reference Pages Index