jp1esalog.sh.def
- Organization of this page
Syntax
jp1esalog.sh.def
Description
The jp1esalog.sh.def command is a command to be executed immediately after occurrence of an error.
First, this command uses the tar command to archive the directories or files that contain log information immediately under the root directory. Then, this command uses the compress command to compress the created archive file. By default, this command creates the /tmp/jp1esa/jp1esa.log.tar.Z file. If this file already exists, the existing file is overwritten.
You can execute this command while SNMP Agent is running.
Location
-
Systems other than AIX: /opt/CM2/ESA/bin
-
AIX: /usr/CM2/ESA/bin
Arguments
None
Who can execute the command
A superuser can execute this command.
Return values
0: Normal termination
8: One of the following runtime errors occurred (an error message is output):
-
The command was not executed as a superuser.
-
The work directory could not be created.
-
The archive file could not be created.
-
The directory for outputting files did not allow writes.
-
The directory for output files could not be created.
Customizable items
This command is a shell script. The following describes what you can customize when using this command.
- Changing the default output file
-
To change the default output file, customize the following line:
# Log output file defaultname OUTFILE="/tmp/jp1esa/jp1esa.log"
When a file name is specified, the following file is created:
specified-file-name.Z
- Changing the work directory
-
To change the work directory, customize the following line:
# Working directory WORKDIR="/tmp/jp1esa/work"
When this command is executed, it creates a temporary work directory in which it temporarily saves the files it creates. This means that the command requires a certain amount of free disk space to operate. By default, this directory is created in the directory that is used to store the output files. Edit the above line if you want to change the location of the work directory.
- Collecting other information such as user-created files
-
To collect other information, customize the following line:
# User Additional files ADDFILE=""
Note that when you specify additional files in the ADDFILE variable, always prefix a period (.) to the full path name of each file, and separate each entry with a space.
Example: ADDFILE="./var/tmp/user_log ./etc/opt/sample/conf"
Notes
-
This command is provided as the jp1esalog.sh.def file. This file is overwritten with a new file every time the product is installed. To retain the file you customized, copy the file to any directory you like, and customize and use the file there.
-
When transferring the collected information via FTP, use the binary mode.
-
When the compress command is not installed in the machine where information is to be collected, this command creates the /tmp/jp1esa/jp1esa.log.tar file without performing compression.
-
The following table lists the data collected by the jp1esalog.sh.def command.
Table 5‒2: List of data collected by the jp1esalog.sh.def command Type
Collected information
Common information
/etc/hosts
/etc/services
/etc/nsswitch.conf (Linux)
/etc/resolv.conf (Linux, Solaris, AIX)
/etc/redhat-release (Linux)
/etc/environment (AIX)
/proc/stat (Linux)
/proc/diskstats (Linux)
Mount configuration files
-
HP-UX (IPF) and Solaris
/etc/mnttab
-
AIX
/etc/filesystems
-
Linux
/etc/fstab
System log files
-
HP-UX (IPF)
/var/adm/syslog/syslog.log
/var/adm/syslog/OLDsyslo.log
-
Solaris
/var/adm/messages
-
Linux
/var/log/messages
The results of journalctl (RHEL 7, CentOS 7, Oracle Linux 7, SUSE Linux 12)
The results of ps -ef
(for Solaris, the results of ps -lf -z zone-name)
The results of ps -e (AIX only)
The results of netstat (with -a, -i, -rv, and -an)
The result of netstat -anp (Linux)
The result of ss -anp (Linux)
The result of ifconfig -a (Linux)
The result of ip addr (Linux)
The result of lsb_release -a (Linux)
The results of uname -a
The results of oslevel -s (AIX)
The results of hostname
The results of id
The results of env
The results of bdf -l or df -k
/etc/.hitachi/pplistd/pplistd
The results of swlist -l product (HP-UX (IPF))
The results of what /usr/sbin/snmpdm (HP-UX (IPF))
The results of what /usr/sbin/mib2agt (HP-UX (IPF))
The results of what /usr/sbin/ipv6agt (HP-UX (IPF))
The results of what /usr/sbin/hp_unixagt (HP-UX (IPF))
The result of ls -alR /tmp
The result of ls -alR /opt/CM2/ESA (except AIX)
The result of ls -alR /usr/CM2/ESA (AIX)
The result of ls -alR /etc
The result of rpm -qa (Linux)
The results of systemctl show jp1_esa.service (RHEL 7, CentOS 7, Oracle Linux 7, SUSE Linux 12)
The results of systemctl list-dependencies jp1_esa.service --after (RHEL 7, CentOS 7, Oracle Linux 7, SUSE Linux 12)
The results of systemctl list-dependencies jp1_esa.service --before (RHEL 7, CentOS 7, Oracle Linux 7, SUSE Linux 12)
The results of systemctl list-unit-files (RHEL 7, CentOS 7, Oracle Linux 7, SUSE Linux 12)
The results of systemctl status jp1_esa.service (RHEL 7, CentOS 7, Oracle Linux 7, SUSE Linux 12)
Configuration files and log files for the native agent
Solaris:
-
/etc/release
-
/var/log/snmpd.log
-
/var/opt/CM2/ESA/log/initdesa.log.err
-
/var/opt/CM2/ESA/log/snmpstart.log.err
-
/var/svc/log/milestone-multi-user:default.log
-
/etc/net-snmp/snmp/snmpd.conf
-
/lib/svc/method/svc-net-snmp
-
/var/svc/log/application-management-net-snmp:default.log
-
The results of /usr/bin/svcs -l svc:/application/management/net-snmp:default
AIX:
-
/etc/snmpd.conf
-
/usr/tmp/snmpd.log
-
/etc/snmpdv3.conf
-
/usr/tmp/snmpdv3.log
-
/etc/aixmibd.conf
-
/usr/tmp/aixmibd.log
-
/etc/hostmibd.conf
-
/usr/tmp/hostmibd.log
-
/etc/snmpmibd.conf
-
/usr/tmp/snmpmibd.log
Linux:
-
/etc/snmp/snmpd.conf
-
/var/log/snmpd.log
For RHEL 7, CentOS 7, Oracle Linux 7, and SUSE Linux 12, the following additional files are collected:
-
/usr/lib/systemd/system/snmpd.service
-
/etc/systemd/system/snmpd.service (if present)
SNMP Agent information
The following files under /var/adm/:
-
snmpd.logn#1, #2
n: Number of log files
snmpd.logn files under SR_LOG_DIR if SR_LOG_DIR is set.
/tmp/jp1esa/work/jp1esalog_err.log
-
/var/opt/CM2/ESA/log/htc_monagt1.log (Solaris, Linux)
-
/usr/CM2/ESA/log/htc_monagt1.log (AIX)
The results of /opt/CM2/ESA/bin/snmpcheck
Data under /etc/SnmpAgent.d
Data under /etc/srconf/agt
Data under /etc/srconf/mgr
-
Data under /opt/CM2/ESA/opt (HP-UX (IPF), Linux)
-
Files whose names begin with /etc/rc.config.d/Snmp (Solaris)
-
Data under /usr/CM2/ESA/opt (AIX only)
-
Data under /opt/CM2/ESA/ext (systems other than AIX)
-
Data under /usr/CM2/ESA/ext (AIX only)
RHEL 7, CentOS 7, Oracle Linux 7, and SUSE Linux 12:
-
/usr/lib/systemd/system/jp1_esa.service
-
/etc/systemd/system/jp1_esa.service (if present)
/core (if present)
/root/core (for Linux and only if present)
-
- #1: Log information, hexadecimal dumps, and VarBind lists are output to the snmpd.logn files. The size and number of snmpd.logn files are specified with the following environment values in the SnmpMaster file:
-
-
File size: SNMP_HTC_SNMPD_LOG_SIZE
The following shows a specification example for the SNMP_HTC_SNMPD_LOG_SIZE environment variable. The unit is megabytes. In the example, 10 megabytes is specified as the file size.
Example:
SNMP_HTC_SNMPD_LOG_SIZE=10 export SNMP_HTC_SNMPD_LOG_SIZE
-
Number of files: SNMP_HTC_SNMPD_LOG_CNT
The following shows a specification example for the SNMP_HTC_SNMPD_LOG_CNT environment variable. The unit is the number of files. In the example, 10 is specified as the number of files.
Example:
SNMP_HTC_SNMPD_LOG_CNT=10 export SNMP_HTC_SNMPD_LOG_CNT
For details about environment variables, see snmpdm.
By default, the size of each file is set to 10 megabytes, which means that in order to create 10 files, an area that can accommodate 100 megabytes must be available for the directory in which the snmpd.logn files are stored.
-
- #2: The following processes send their output to the snmpd.logn files:
-
snmpdm, naaagt, hp_unixagt, extsubagt, trapdestagt, htc_unixagt1, htc_unixagt2, htc_unixagt3, htc_unixagt4