sysconf snmp trap test

Test the SNMP trap notification.

This command allows an administrator to create test logs to initiate trap notifications. Refer to About the Syslog and SNMP Monitoring Guide for details of which log messages result in traps.

To initiate a trap notification use the command parameters to format and record a log message via syslog. To distinguish between messages in the logs that are generated by this command and those that represent legitimate events, all log messages generated using this command are prefixed with “***TEST :”, as shown in the following example:

2012 Feb 29 12:05:01 myLUT  daemon crit  smartd[19685]: ***TEST : Device: /dev/sda, Temperature 45 Celsius reached limit of 44 Celsius (Min/Max 31/49)

The Luna administrative shell prohibits the ‘<’ and ‘>’ characters as parameters. However, some traps rely on the presence of these comparators in log messages. To enable test log messages of the form that need these comparators, use a “.lt” or “.gt” string in place of the ‘<’ or ‘>’ character in the formatted command.

NOTE   This command writes a record to the applicable system log file. The command has no dependency on the status of the Luna SNMP Trap Daemon. To test trap generation, ensure that you have enabled traps as described in About the Syslog and SNMP Monitoring Guide.

User Privileges

Users with the following privileges can perform this command:

>Admin

>Operator

Syntax

sysconf snmp trap test -logfacility <logfacility> -loglevel <loglevel> -process <process> -message <message> [-pid]

Argument(s) Shortcut Description
-logfacility <logfacility> -logf

Specifies the log facility to use when generating the test message.

Valid values: kern, user, daemon, auth, syslog, authpriv, cron, local0, local1, local2, local3, local4, local5, local6, local7

-loglevel <loglevel> -logl

Specifies the severity level to assign to the test message.

Valid values: emergency, alert, critical, crit, error, err, warning, warn, notice, info, debug

-process <process> -pr

Specifies the system process to use when generating the test message.

Valid values: Any process defined for the system. For example, NTLS, impievd, smartd, sysstatd.

-message <message> -m

A string that specifies the body text for the test message.

You must enclose the string in double quotes ("<string>") if it contains spaces.

-pid -pi

Add a process identifier to the test message.

Example

lunash:>sysconf snmp trap test -logfacility daemon -loglevel crit -process smartd -message "Device: /dev/sda, Temperature 45 Celsius reached limit of 44 Celsius (Min/Max 31/49)" -pid


Command Result : 0 (Success)