ActionSyslog
,
Syslog
action
Syntax
Inside a callback action:
ActionSyslog(
["<PROTOCOL>:<IP_ADDR>:<PORT>
",]
"<log_message>"
[, severity=<severity>]
[, facility=<facility>]
[, title=<title>])
Outside of a callback action:
self.r.action("Syslog",
["<PROTOCOL>:<IP_ADDR>:<PORT>",]
"<log_message>"
[, severity=<severity>]
[, facility=<facility>]
[, title=<title>])
Description
The
ActionSyslog
action enters the specified message in the
syslog.log
file configured on the syslog server.
Parameters
<log_message>
A text string of the message to be entered into the log.
The size and content of this message is subject to the same requirements as any other syslog message on this system.
<severity>
Specifies the severity of the log message.
The possible values are the following:
SYSLOG_EMERG
SYSLOG_ALERT
SYSLOG_CRITICAL
SYSLOG_ERROR
SYSLOG_WARNING
SYSLOG_NOTICE
SYSLOG_INFO
SYSLOG_DEBUG
Default: SYSLOG_INFO
<facility>
Specifies the program that is logging the message.
The possible values are the following:
SYSLOG_AUTH
SYSLOG_AUTHPRIV
SYSLOG_CRON
SYSLOG_DAEMON
SYSLOG_FTP
SYSLOG_KERN
SYSLOG_LPR
SYSLOG_MAIL
SYSLOG_SYSLOG
SYSLOG_USER
SYSLOG_UUCP
SYSLOG_LOCAL0
SYSLOG_LOCAL1
SYSLOG_LOCAL2
SYSLOG_LOCAL3
SYSLOG_LOCAL4
SYSLOG_LOCAL5
SYSLOG_LOCAL6
SYSLOG_LOCAL7
Default: SYSLOG_DAEMON
<PROTOCOL>:<IP_ADDR>:<PORT>
Optional. Used only for remote system logs.
<title>
Specifies the title to be displayed for this action. The definition of
<title>
must use theTitle
function.For example:
title=Title("Report CPU utilization")
Usage
Use this action to send a standard syslog message to the
syslog.log
file. Standard syslog messages are labeled with a severity level and a facility code that indicates the type of software generating the message.
Only the specified message is sent to the log—additional information such as the monitor or agent name is not included.
When using a remote system log server, configure the remote server to receive the logs from
hpe-agentd
. The
hpe-agentd
daemon provides the required information, such as the valid hostname and message severity levels.
You can create a custom title for this action. The title you create can help the user of the Web UI to determine what action was executed. The title is displayed in the Action Results section of the Alert Details dialog box.
Examples
The following example sends a message to the local system log, using the parameter
message
, inside a callback action:
ActionSyslog("Sample message: {}", [self.params["message"]])
The following example sends a message to the local system log, using the parameter
message
, outside of a callback action:
self.r.action("Syslog", "Sample message: {}", [self.params["message"]])
The following example sends a system log message to a remote machine at IP address
10.17.0.2
using TCP on port 444:
ActionSyslog("Sample message: {}", "tcp:172.17.0.2:444", [self.params["message"]])
The following example includes a message severity and sending facility:
self.r1.action(
Syslog, "tcp:172.17.0.1:514", ">>> low_threshold: {}",
[self.params['low_threshold']], severity=SYSLOG_WARNING, facility=SYSLOG_DAEMON)