Home > |
---|
Test the SNMP trap notification.
This command allows an administrator to create test logs to initiate trap notifications. Refer to the Syslog 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)
Note: The SafeNet 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 SafeNet SNMP Trap Daemon. To test trap generation, ensure that you have enabled traps as described in the Syslog and SNMP Monitoring Guide.
sysconf snmp trap test -logfacility <logfacility> -loglevel <loglevel> -process <process> -message <message> [-pid]
Parameter | Shortcut | Description |
---|---|---|
-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 | -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 | -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 | -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. |
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)