icinga2-classicui shows Whoops error on new Icinga 2.8 install

Written by - 0 comments

Published on - Listed in Icinga Monitoring Linux

So it seems that icinga2-classicui disappeared from the official installation documentation (see screenshot from the table of contents) and was replaced by icingaweb2:

Icinga 2 documentation lacks classicui

But that doesn't mean that icingaweb2 is forcibly better than the classicui was.

Yes, it has a newer design, reacts faster and offers live data (e.g. time since last status change counts dynamically up). But I still feel "at home" with the classic UI and I find myself working quicker with the classicui. Maybe it's just out of habit, but old habits die hard.

Icinga2 Icingaweb2

Anyway, since the classicui was removed from the documentation, there's something important missing now. When you install icinga2-classicui and you want to launch it in your browser, you see the following error message:

Icinga2 classicui whoops error

Ouch! Erm, I mean Whoops! The reason for this is the webserver user (www-data in Debian/Ubuntu) is unable to read the contents from /var/cache/icinga2/objects.cache. This can be found out if the classicui is configured to do some logging:

root@inf-mon02-t:~# grep log /etc/icinga2-classicui/cgi.cfg

Note I enabled "use_logging" and set the log path to /var/log/icinga2/icinga-cgi.log. Make sure www-data (your webserver user) is able to write that file:

root@inf-mon02-t:~# touch /var/log/icinga2/icinga-cgi.log
root@inf-mon02-t:~# chown www-data /var/log/icinga2/icinga-cgi.log

The next time you access the classicui, this error will be logged:

[1512728139] Error: Cannot open config file '/var/cache/icinga2/objects.cache' for reading: Permission denied

As I mentioned above, www-data must be able to read the Icinga2 objects cache file. By default (from the Icinga2 packet installation), the permissions are like this:

root@inf-mon02-t:/var/cache# ll
total 36
drwxr-xr-x 3 root   root   4096 Dec  7 11:57 apache2
drwxr-xr-x 2 root   root   4096 Aug 31 23:30 apparmor
drwxr-xr-x 3 root   root   4096 Dec  7 14:18 apt
drwxr-xr-x 2 root   root   4096 Dec  8 07:25 apt-show-versions
drwxr-xr-x 3 root   root   4096 Dec  7 11:56 dbconfig-common
drwxr-xr-x 2 root   root   4096 Dec  7 14:18 debconf
drwxr-x--- 2 nagios nagios 4096 Dec  8 11:14 icinga2
drwx------ 2 root   root   4096 Dec  7 13:29 ldconfig
drwxr-xr-x 2 root   root   4096 Nov 16 13:39 samba

root@inf-mon02-t:/var/cache# ll icinga2/
total 952
-rw------- 1 nagios nagios 867562 Dec  8 11:04 icinga2.debug
-rw------- 1 nagios nagios   6221 Dec  8 11:04 icinga2.vars
-rw-r--r-- 1 nagios nagios  70613 Dec  8 11:04 objects.cache
-rw-r--r-- 1 nagios nagios  23117 Dec  8 11:15 status.dat

I checked my old documentations for Icinga2 installations and indeed; the part where www-data is assigned to the nagios group (nagios user and group are used by the icinga2 package installation). This is now missing in the official Icinga2 documentation because it is now relevant to icingaweb2. To fix it:

root@inf-mon02-t:~# usermod -a -G nagios www-data
root@inf-mon02-t:~# service apache2 restart

Much better now:

Icinga2 classicui fixed

Add a comment

Show form to leave a comment

Comments (newest first)

No comments yet.

RSS feed

Blog Tags:

  AWS   Android   Ansible   Apache   Apple   Atlassian   BSD   Backup   Bash   Bluecoat   CMS   Chef   Cloud   Coding   Consul   Containers   CouchDB   DB   DNS   Database   Databases   Docker   ELK   Elasticsearch   Filebeat   FreeBSD   Galera   Git   GlusterFS   Grafana   Graphics   HAProxy   HTML   Hacks   Hardware   Icinga   Icingaweb   Icingaweb2   Influx   Internet   Java   KVM   Kibana   Kodi   Kubernetes   LVM   LXC   Linux   Logstash   Mac   Macintosh   Mail   MariaDB   Minio   MongoDB   Monitoring   Multimedia   MySQL   NFS   Nagios   Network   Nginx   OSSEC   OTRS   Office   PGSQL   PHP   Perl   Personal   PostgreSQL   Postgres   PowerDNS   Proxmox   Proxy   Python   Rancher   Rant   Redis   Roundcube   SSL   Samba   Seafile   Security   Shell   SmartOS   Solaris   Surveillance   Systemd   TLS   Tomcat   Ubuntu   Unix   VMWare   VMware   Varnish   Virtualization   Windows   Wireless   Wordpress   Wyse   ZFS   Zoneminder   

Update cookies preferences