4.3.1 Collecting information with the adapter command
If you create a user-created plug-in and retrieve information from a management target in JP1/IM - Manager (Intelligent Integrated Management Base), you need an adapter command together with the plug-in. You execute the adapter command only once. You execute the adapter command several times and cannot acquire information. In addition, the adapter command has a one-to-one relationship with the user-created plug-in.
The adapter command communicates with the Intelligent Integrated Management Base via the standard input and output. When started from the Intelligent Integrated Management Base, the adapter command sends a response to the Intelligent Integrated Management Base via the standard output.
- Organization of this subsection
(1) Return values
The adapter command gives back the summary of an operation result as a return value.
No. |
Return value |
Description |
---|---|---|
1 |
0 |
Successful completion |
2 |
1 to 49 |
These values are assigned to an error when a warning occurs. (For example, a failure to collect part of information) |
3 |
50 to 99 |
These values are assigned to a temporary error of the operation that can be retried. |
4 |
100 to 149 |
Invalid environment (such as an incorrect version) |
5 |
150 to 199 |
Program error |
You can also add a return value specific to the adapter command within the range of the return values. The details of an error at runtime of the adapter command must be returned separately via the standard error output.
(2) Execution directory
The directory where the adapter commands is located as the execution directory.
(3) Input/output
Arguments, the standard input, the standard output, and the standard error output are used for data communication between the adapter command and the Intelligent Integrated Management Base.
The standard input and standard output of the adapter command is made up of common header and data body. The data body contains the information passed from the adapter command to the Intelligent Integrated Management Base.
The format is as follows:
Common header<Line feed code (<CR><LF> or <LF>)>Data body
The structure of the header is shown below. The header is expressed in CSV format.
protocol-name,protocol-version,character-code,program-product-name
The following table lists the details of the header:
No. |
Name |
Data type |
Value to be specified |
---|---|---|---|
1 |
protocol-name |
string |
JBSPGCMD |
2 |
protocol-version |
Specify the same version as the version of the adapter command settings file#.
|
|
3 |
character-code |
Specify one of the following character codes based on the execution environment of the adapter command:
|
|
4 |
program-product-name |
Specify the same value as the component identifier#. |
If an error occurs during execution of the adapter command, the details are printed to the standard error output. Configure the details to be printed in ASCII characters.
(4) Notes
-
The following commands are not available as the adapter command:
-
Command that requires a sub-entry command (interactive operation)
-
Command that involves escape sequences and control codes
-
Command that opens a window at the location where the command is executed
-
Command that does not end, such as a daemon
-
-
The user may start more than one instance of the adapter command at the same time. If starting two or more instances of the adapter command simultaneously is not allowed, add an exclusive operation of its own to the command so that it returns a busy response when the second instance is started.
-
Data cannot be sent and received simultaneously via the standard input and output. The adapter command that receives a request via the standard input must start sending response data after receiving all the request data.
-
The adapter command is executed under the following permissions:
-
In Windows: SYSTEM
-
In UNIX: root
-
-
A timeout period is set on the adapter command. Thus, the response must be returned before the command times out. The timeout period is 60 minutes.
(5) Adapter command settings file
An adapter command settings file is used to specify the name of the file for the adapter command. The naming rule is as follows:
name-of-the-component-specified-for-Adapter_SID.conf
- Example
-
When the name-of-the-component-specified-for-Adapter_SID is /VENDOR/TOOLA:
Adapter_VENDOR_TOOLA.conf
The adapter command settings file is located at:
- In Windows:
-
JP1/Base-installation-folder\plugin\conf
- In UNIX:
-
/opt/jp1base/plugin/conf
The table below lists the setting items of the adapter command settings file. Use a tab or white space character to separate a label and its value.
No. |
Item |
Label |
Value to be specified |
---|---|---|---|
1 |
Version of the adapter command settings file |
fileversion |
12000000 |
2 |
Path to the adapter command |
cmdpath |
Specify the absolute path to the adapter command, including the command name. You do not have to enclose the path with double quotation marks or other characters. |
3 |
Product that links with the adapter command |
upperpp |
/HITACHI/JP1/IM/DD |
4 |
Type of the adapter command |
componenttype |
JDD_CONFINFO |
The following shows a setting example of the adapter command settings file:
fileversion 12000000 cmdpath C:\Program Files (x86)\Hitachi\jp1pc\bin\jp1getconfinfo.exe upperpp /HITACHI/JP1/IM/DD componenttype JDD_CONFINFO
- Important
-
-
A single line can contain a maximum of 4,096 characters.
-
If there is more than one label with the same name, an error occurs.
-
If the required label is not specified, an error occurs.
-
If even a single error exists in the file, the file is no longer valid.
-
The file is terminated with the line feed character.
-
The file can contain ASCII characters only.
-
When you specify a label, a white space or tab character is not allowed at the beginning of the row.
-
Any row containing white space or tab characters only is ignored.
-