Project

General

Profile

User guide

User documentation
02/07/2012

Overview:
The Exemption Notifier is a CLI tool that sends e-mail alerts when a TIssue
exemption for a particular system is about to expire.

The package includes two components which can be used to operate with e-mail notification about exemption expiration date:

- Shell script: start_exmp_notifier.sh

- CLI tool : Exmp_Notifier.py

Shell Script.
The shell script is designed to work with any scheduler. It verifies the expiration date of all TIssue exemption.

It has only one required argument with a digital parameter:
-d # or -w # ,which allows the user to specify the number of days(-d)
or weeks (-w) before exemption expiration date the e-mail notification
should be sent.

The e-mail template and log file are set by default:

- email template is in environment variable 
EMAIL_TEMPLATE= /Exemption_Notifier/bin/email_template
- log file is in CLI --log_file=/Exemption_Notifier/log/Exmp_notifier.log

Example:
start_exmp_notifier.sh -w 3
or
start_exmp_notifier.sh -d 10

CLI tool.
Exemption Notifier accepts a variety of command line options and arguments
to indicate how the tool should operate.
The CLI commands are separated into three categories:
- Exemption filters
- Flags
- Definitions
Any number of Exemption filter’s arguments can be selected by the user and the combination of them will be considered as logical AND.

1. Exemption filters:

--exmp_id = is an optional argument that limits processing to a particular exemption ID.  The default value is to process all exemption IDs.  If this argument is present, then only the exemptions with specified IDs will be considered. The parameters of this argument can be multiple IDs separated by comma, without any spaces.

Example:
Exmp_Notifier.py --exp_in_days=21--exmp_id=2,15,221,35,67,89,101 ....

In this example all exemptions with listed IDs will be verified against expiration date. If the TIssue exemption expires within 21 days, then an e-mail notification will be sent to system primary administrator whose e-mail can be found in MISCOMP database.

--exmp_type= is an optional argument that limits processing of exemption types. The default value is to process all exemption types. If this argument is present, then only the exemption with the supplied type will be considered. The code must allow for both, short and long, names for the exemption types. The names are defined in a separate file listing the short name - one character, and the long name - the name of the exemption. The parameters for exemption types are not case sensitive.

Below is a table of allowed exemption types:

Short Long
s scanning
b blocking
i issue

Example:
Exmp_Notifier.py --exp_in_days=12 --exmp_type=Blocking
or
Exmp_Notifier.py --exp_in_days=12 --exmp_type=b

In this example the e-mail will be sent for all blocking-type exemptions the expiration date of which is within 12 days.

--system_name= is an optional argument that limits processing to a particular system. The default value is to process all systems.  If this argument is present, then only exemptions with the supplied system will be considered. The parameters of this argument can be multiple systems separated by commas, without any spaces. The parameters for system_name argument are not case sensitive.

Example:
Exmp_Notifier.py --exp_in_weeks=3 --system_name=system1,system2,system3 ....

In this example all exemptions for listed system names will be verified against expiration date. If TIssue exemption expires within 3 weeks, then an e-mail notification will be sent to system primary administrator whose e-mail can be found in MISCOMP database.

--exmp_behavior= is an optional argument that limits processing to exemptions with particular behaviors.  The default value is to process exemptions regardless of their defined behavior. If this argument is supplied, then only exemptions that match the specified behavior will be considered for processing. The parameter for exemption behavior is not case sensitive.

Example:
Exmp_Notifier.py --exp_in_weeks=2 --exmp_behavior=ign

In this example the e-mail will be sent for all exemptions with specified exemption behavior the expiration date of which is within 2 weeks.

2. Flags:

-d : is an optional flag that allows to print additional and useful debugging information to the output stream.

Example:
Exmp_Notifier.py --exp_in_days=35 -d

In this example an e-mail notification will be sent for all exemptions the expiration date of which is within 35 days and debug messages will be shown in output stream.

-v : is an optional flag that allows to print information about each exemption indicating whether or not a notification has been sent. Can be used for exemption inventory with specific exemption selection by CLI options.

Example:
Exmp_Notifier.py --exp_in_weeks=5 –v

In this example all TIssue exemptions will be printed indicating whether or not an e-mail notification is sent. Also, an e-mail notification will be sent for all exemptions the expiration date of which is within 5 weeks.

This flag can be used with the suppress flag:
Exmp_Notifier.py --exp_in_days=10 -n –v

In this case, e-mail notifications will not be sent.

-n : is an optional flag that suppresses sending the e-mail. This flag, and the two arguments: --email_to and --email_cc, can not be used in the same command (mutually exclusive).

Example:
Exmp_Notifier.py --exp_in_days=10 –n

3. Definitions:

--template= is a required argument which specifies location and file name of e-mail messages. It can be defined by an environment variable “EMAIL_TEMPLATE”. The template allows for three parameters:
- exemption ID ($exemp_id)
- system name ($system_name)
- expiration date ($date)
The location of the email template can be specified by either an environment variable or a command line option. If a command line option is supplied, it takes precedence over the environment variable.

Example:
Exmp_Notifier.py --exp_in_days=10 --template=/home/user/another_email_template

In this example another email template will be used for notification. Three tokens must be present in the new email template.

--exp_in_days= <OR> --exp_in_weeks= are two allowed arguments which define when an exemption is about to expire. These arguments are given in days or weeks. Only ONE of these arguments is required to be in the command line.

Example:
Exmp_Notifier.py --exp_in_weeks=1

In this example all TIssue exemptions will be verified and e-mail notifications will be sent for any exemption the expiration date of which is within 1 week.

--log_file= is an optional argument that specifies the path where the log-file should be located and file name of the log-file. The default is “./log/Exemption_Notifier.log”

Example:
Exmp_Notifier.py --exp_in_days=12 --log_file=/home/user1/report/exemption_notifier.log

In this example the log information will be stored in the user's directory.

--email_to= is the optional argument that directs where the email is sent. The default is to send the email to the primary system administrator or system owner as defined in MISCOMP.

Example:
Exmp_Notifier.py --exp_in_days=21 --email_to=

In this example the e-mail from MISCOMP will be replaced with the specified e-mail address where the notification will be sent.

--email_cc= is the optional argument that directs where the copy of e-mail is sent. The default is no copy e-mail.

Example:
Exmp_Notifier.py --exp_in_days=12 --email_cc=

In this example the e-mail_cc will be specified by user e-mail_cc address and a copy of notification will be sent to that address.

Files