When Icinga2 sends a host or service alert, we get the following garbage text before seeing the information we need:
Usage:
icinga2 <command> [<arguments>]
Supported commands:
api setup (setup for API)
ca list (lists all certificate signing requests)
ca sign (signs an outstanding certificate request)
console (Icinga console)
daemon (starts Icinga 2)
feature disable (disables specified feature)
feature enable (enables specified feature)
feature list (lists all available features)
node setup (set up node)
node wizard (wizard for node setup)
object list (lists all objects)
pki new-ca (sets up a new CA)
pki new-cert (creates a new CSR)
pki request (requests a certificate)
pki save-cert (saves another Icinga 2 instance’s certificate)
pki sign-csr (signs a CSR)
pki ticket (generates a ticket)
troubleshoot (collect information for troubleshooting)
variable get (gets a variable)
variable list (lists all variables)
Global options:
-h [ --help ] show this help message
-V [ --version ] show version information
–color use VT100 color codes even when stdout is not a
terminal
-D [ --define ] arg define a constant
-I [ --include ] arg add include search directory
-x [ --log-level ] arg specify the log level for the console log.
The valid value is either debug, notice,
information (default), warning, or critical
-X [ --script-debugger ] whether to enable the script debugger
Report bugs at LINK
Get support: LINK
Documentation: LINK
Icinga home page: LINK
Is there a way we can remove the unneeded text in our email alerts? I’ve tried to look in all the configs that I know of but cannot see a way. Any help is greatly appreciated.
Please encapsulate code, snippets, logs, config within three backticks for better readability. I’ve edited your post once to make it a bit more readable - please edit it again.
CentOS 7.5. These are the only modifications I am aware of. Just wondering if we can remove the garbage in the initial warning/critical email that is sent as shown in my initial post. It looks like it’s being put there by icinga…
That’s the output of icinga2 when invoked on the shell, without any parameters. That’s why I was looking for an occurrence of this single command invocation, inside the bash script.
This doesn’t happen if you use the proposed dummy script, right?
Question aside, what happens when you invoke hostname on your command shell?