Hitachi

JP1 Version 12 JP1/Integrated Management 2 - Manager Command and Definition File Reference


jimmail (Windows only)

Organization of this page

Function

This command sends an email to a specified email address.

To use the jimmail command to send an email, you must set the email environment definition file.

You can execute this command independently regardless of whether the JP1/IM - Manager service is running. The following table describes the functions of JP1/IM - Manager that can be used to send an email.

Table 1‒48: JP1/IM - Manager functions used to send an email by using the jimmail command

Function

Description

Automated action

An email can be sent by automated action.

Monitoring action and delay statuses

An email can be sent by using the notification command when an action error is detected.

Health check

An email can be sent by using the notification command when a JP1/IM - Manager process error is detected.

Command execution (Command button)

An email can be sent by pressing a command button.

If the maximum length of a command line is exceeded, redefine the email contents so that the command line of the jimmail command can fit within the limit.

Format

jimmail [-to destination-email-address[,destination-email-address...]]
        [-s email-subject]
        [-b email-text]
        [-rh logical-host-name]

Execution permission

Administrator permissions (If the Windows UAC feature is enabled, the command is executed from the administrator console.)

Storage directory

Console-path\bin\

Arguments

-to destination-email-address[,destination-email-address...]

This option specifies the email destination address.

A maximum of 20 email addresses can be specified. Note, however, that addresses exceeding the maximum command line length cannot be specified. When specifying multiple email addresses, use a comma (,) as a separator. Any one-byte space or tab between an email address and a comma is ignored. Consecutive commas (,) are treated as a single comma, and commas at the beginning and at the end are ignored. If the same email address is specified more than once, the email message is sent to the specified address only once.

If the number of specified email addresses exceeds the maximum limit, the KAVB8725-E message is output, and the operation terminates abnormally.

You can specify 1 to 256 bytes of characters for the destination email address. One-byte alphanumeric characters, at marks (@), hyphens (-), underscores (_), and periods (.) can be specified.

This option can be omitted. If you omit this option, processing continues using the email address specified for the DefaultTo parameter (default destination email address) in the email environment definition file as the destination. When an email is being processed, the message sent to the email address of the DefaultTo parameter is not output.

If the -to option is omitted, and no email address is specified for the DefaultTo parameter, the jimmail command outputs an error message, and the operation terminates abnormally.

If both the -to option and the DefaultTo parameter are set, the -to option takes precedence.

The jimmail command does not check if the specified email address is valid.

-s email-subject

This option specifies the email subject.

You can specify 1 to 512 bytes of characters. The character count is determined by calculating the byte count based on the email character encoding specified by the Charset parameter in the email environment definition file. When event or action information is to be inherited, the maximum-length check is performed by calculating the length after $variable-name has been replaced. If the calculated length exceeds the maximum length, the value specified for the MailSubjectCutting parameter in the email environment definition file determines whether the subject is to be cut to allow the email to be sent.

  • When the MailSubjectCutting parameter value is OFF, the KAVB8708-E message is output, and the command terminates abnormally.

  • When the MailSubjectCutting parameter value is ON, characters for the email subject exceeding 512 bytes are discarded according to the character encoding specified for the Charset parameter, and the email is sent. When an email subject exceeds 512 bytes, characters exceeding 512 bytes are discarded. If an email is sent after the exceeding characters in the subject are discarded, the KAVB8724-W message appears before the KAVB8729-I message (indicating the email is sent successfully).

This option can be omitted. If you omit this option, the subject of the email will be a null character ("").

If the email subject contains blank characters, enclose the subject in double-quotation marks (").

Even if you specify \n, a line break is not created in the email subject. If you specify \n, it appears as is. Line feed codes and control characters are converted into one-byte spaces.

-b email-text

This option specifies the email text.

You can specify 1 to 4,096 byte characters for the email text. The number of characters is checked by the number of bytes, according to the character encoding of the email specified by the Charset parameter in the email environment definition file. To inherit event or action information, check the maximum length after replacing $variable-name.

You can specify 1 to 512 byte characters including linefeed codes for a line. If the characters exceed 512 bytes, insert a linefeed code so that the line will be a maximum of 512 bytes including linefeed codes. When a line exceeds the number, no warning message is output.

This option can be omitted. If you omit this option, the email text will be null characters ("").

If there is no linefeed code at the end of the last line, a linefeed code is inserted.

If the email text contains null characters, enclose and specify the email text by the double-quotation marks (").

When \n is specified in the email text, a new line starts after the linefeed code specified by the MailNewLine parameter in the email environment definition file. If the value of the parameter is not CRLF, CR, or LF, \n is converted to a single-byte space.

To enter \n as a character string, specify it as \\n.

-rh logical-host-name

When JP1/IM - Manager is used in a cluster, the -rh option specifies the email environment definition file to use. With this option, specify if the jimmail command uses the email environment definition file on a physical host, or in the shared folder on a logical host.

If you specify this option, the email environment definition file is loaded to a shared folder on the specified logical host, and the email is sent.

If you omit this option, the email environment definition file is loaded to a physical host, and then the email is sent.

Note that if you omit this option, the logical hostname specified for the JP1_HOSTNAME environment variable is assumed. If he JP1_HOSTNAME environment variable is not specified, the physical host name is assumed. If you do not use JP1/IM - Manager in a cluster, it is not necessary to specify this option.

Note

Return values

Return value

Description

0

Normal termination

1

Argument error

2

Destination email address is not specified.

3

Error while reading the email environment definition file

4

Format error of the email environment definition file

(Invalid setting value, essential item not specified, invalid parameter)

5

A timeout error occurred while connecting to the SMTP server

6

SMTP server rejected the login

7

Connection to the SMTP server could not be established

8

A timeout error occurred while connecting to the POP3 server

9

POP3 server rejected the login

10

Connection to the POP3 server could not be established

11

Sending an email failed

12

Insufficient memory

13

Execution permission error

255

Other errors

Example

The following is an email notification example from the manager host (jp1imhost001) to the system administrator (user@hitachi.com) about a failure on the monitored host (gyoumu001) through automated action, and the contents of the email to be sent:

jimmail.exe -to user@hitachi.com -s "[severity:$EVSEV] Failure notification" -b "A failure occurred on the business server. \n---\n event DB serial number=$EVSEQNO\nevent-occurrence-date-and-time=$EVDATE $EVTIME\nEvent ID=$EVIDBASE\nSeverity=$EVSEV\nProduct name=$EV"PRODUCT_NAME"\nMessage=$EVMSG\n---\nFrom:IM-M host ($ACTHOST)"

Example of email notification:

Source (From)

admin@hitachi.com

Destination (To)

user@hitachi.com

Email subject

[Severity:Error] Failure notification

Email text

A failure occurred on the business server.

---

Serial number in the event database=1234567

Event occurrence date and time=2014/01/01 10:00:00

Event ID=000A

Severity=Error

Product name=/HITACHI/XXXXX/JP1

Message=A system error occurred on the business server

---

From:IM-M host (jp1imhost001)