New Icinga2 Installation: Missing icinga2.cmd file

AWS Ec2 Service
OS: Ubuntu 18.04 LTS
Memory: 2 GB
Swap:
NAME TYPE SIZE USED PRIO
/swapfile file 1024M 0B -2
Database: MySQL

Build information:
Compiler: GNU 8.3.0
Build host: runner-LTrJQZ9N-project-298-concurrent-0

Application information:

General paths:
Config directory: /etc/icinga2
Data directory: /var/lib/icinga2
Log directory: /var/log/icinga2
Cache directory: /var/cache/icinga2
Spool directory: /var/spool/icinga2
Run directory: /run/icinga2

Old paths (deprecated):
Installation root: /usr
Sysconf directory: /etc
Run directory (base): /run
Local state directory: /var

Internal paths:
Package data directory: /usr/share/icinga2
State path: /var/lib/icinga2/icinga2.state
Modified attributes path: /var/lib/icinga2/modified-attributes.conf
Objects path: /var/cache/icinga2/icinga2.debug
Vars path: /var/cache/icinga2/icinga2.vars
PID path: /run/icinga2/icinga2.pid


Hello,
I just completed a new installation of Icinga2 for Ubuntu 18.04 LTS using the following installation for Ubuntu 18.04 guide. I notice that I could not “Acknowledge,” messages, for when doing so, got the following errors:

icinga2: Can’t send external Icinga command to the local command file “/var/run/icinga2/cmd/icinga2.cmd”: Permission denied.

root@ip-172-31-2-78:/var/run/icinga2/cmd# icinga2 daemon -x notice -C | grep -i command

[2020-03-12 18:40:25 +0000] notice/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/ command -icinga.conf
[2020-03-12 18:40:25 +0000] notice/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/ command -plugins.conf
[2020-03-12 18:40:25 +0000] notice/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/ command -plugins-manubulon.conf
[2020-03-12 18:40:25 +0000] notice/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/ command -plugins-windows.conf
[2020-03-12 18:40:25 +0000] notice/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/ command -nscp-local.conf
[2020-03-12 18:40:25 +0000] notice/ConfigCompiler: Compiling config file: /etc/icinga2/conf.d/ command s.conf
[2020-03-12 18:40:25 +0000] information/ConfigItem: Instantiated 2 Notification Command s.
[2020-03-12 18:40:25 +0000] information/ConfigItem: Instantiated 235 Check Command s.

root@ip-172-31-2-78:/var/run/icinga2/cmd# ls -l /etc/icinga2/features-enabled

total 0

lrwxrwxrwx 1 nagios nagios 34 Mar 12 16:18 checker.conf -> …/features-available/checker.conf
lrwxrwxrwx 1 nagios nagios 36 Mar 12 17:48 ido-mysql.conf -> …/features-available/ido-mysql.conf
lrwxrwxrwx 1 nagios nagios 34 Mar 12 16:18 mainlog.conf -> …/features-available/mainlog.conf
lrwxrwxrwx 1 nagios nagios 39 Mar 12 16:18 notification.conf -> …/features-available/notification.conf

root@ip-172-31-2-78:/var/run/icinga2/cmd# icinga2 feature list

Disabled features: api command compatlog debuglog elasticsearch gelf graphite influxdb livestatus opentsdb perfdata statusdata syslog
Enabled features: checker ido-mysql mainlog notification
root@ip-172-31-2-78:/var/run/icinga2/cmd#

root@ip-172-31-2-78:/var/run/icinga2/cmd# find / -name icinga2.cmd

root@ip-172-31-2-78:/var/run/icinga2/cmd#

Which show that the icinga2.cmd was not found.

cat /var/log/syslog

:
Mar 12 19:00:57 ip-172-31-2-78 systemd[1]: Started Service for snap application amazon-ssm-agent.amazon-ssm-agent.
Mar 12 19:00:57 ip-172-31-2-78 snapd[3091]: storehelpers.go:436: cannot refresh: snap has no updates available: “amazon-ssm-agent”, “core”
Mar 12 19:00:58 ip-172-31-2-78 amazon-ssm-agent.amazon-ssm-agent[3345]: 2020/03/12 19:00:58 Failed to load instance info from vault. RegistrationKey does not exist.
Mar 12 19:00:58 ip-172-31-2-78 amazon-ssm-agent.amazon-ssm-agent[3345]: Error occurred fetching the seelog config file path: open /etc/amazon/ssm/seelog.xml: no such file or directory
Mar 12 19:00:58 ip-172-31-2-78 amazon-ssm-agent.amazon-ssm-agent[3345]: Initializing new seelog logger
Mar 12 19:00:58 ip-172-31-2-78 amazon-ssm-agent.amazon-ssm-agent[3345]: New Seelog Logger Creation Complete
Mar 12 19:00:58 ip-172-31-2-78 amazon-ssm-agent.amazon-ssm-agent[3345]: 2020-03-12 19:00:58 ERROR Error adding the directory to watcher: no such file or directory
Mar 12 19:00:59 ip-172-31-2-78 amazon-ssm-agent.amazon-ssm-agent[3345]: 2020-03-12 19:00:59 INFO Entering SSM Agent hibernate - AccessDeniedException: User: arn:aws:sts::967480974682:assumed-role/EC2InstanceRole/******** is not authorized to perform: ssm:UpdateInstanceInformation on resource: arn:aws:ec2:us-west-1:*****
Mar 12 19:00:59 ip-172-31-2-78 amazon-ssm-agent.amazon-ssm-agent[3345]: #011status code: 400, request id: 7cc6e935-3e89-4447-b2ae-3dee8e6db798
Mar 12 19:00:59 ip-172-31-2-78 amazon-ssm-agent.amazon-ssm-agent[3345]: 2020-03-12 19:00:59 INFO Agent is in hibernate mode. Reducing logging. Logging will be reduced to one log per backoff period
Mar 12 19:01:25 ip-172-31-2-78 systemd[1]: Started Daily apt download activities.
Mar 12 19:05:06 ip-172-31-2-78 systemd[1]: Stopping Icinga host/service/network monitoring system…
Mar 12 19:05:07 ip-172-31-2-78 systemd[1]: icinga2.service: Killing process 1771 (icinga2) with signal SIGKILL.
Mar 12 19:05:07 ip-172-31-2-78 systemd[1]: Stopped Icinga host/service/network monitoring system.
Mar 12 19:05:07 ip-172-31-2-78 systemd[1]: Starting Icinga host/service/network monitoring system…

Please advise.

Hi & welcome to the icinga community,

you need to enable the according feature:

icinga2 feature enable command

Please be aware that this is deprecated and will be removed in future releases (as described here) and use REST API instead.

2 Likes

HI and welcome,

dont use command feature anymore please. it will be removed soon.
You can easily use the API for icingaweb2 (its also recommended to use it.).
See https://icinga.com/docs/icingaweb2/latest/doc/20-Advanced-Topics/#icinga-web-2-manual-configuration-monitoring-module

Regards,
Carsten

1 Like

Thank you. I used the “icinga2 feature enable command,” for I was in a hurry. But I will circle back to the API method.