Or, there’s more to systemd than just service files.
I recently had cause to investigate writing a simple Nagios http monitor and although I’ve worked in and around Nagios I’ve not really had cause to try writing the monitor scripts.
There was an aspect of the task I wasn’t too sure about so I thought the best way to get to grips with fully understanding the environment would be to try and get Nagios running on my desktop system.
Moral of the story: there’s a reason why Arch will never be used in an enterprise environment.
First, I should have been warned off by seeing that nagios for Arch only comes via the AUR.
But, there’s a reasonably detailed page describing it. The real problems came with nginx, php-fpm and fastcgi.
The php-fpm service isn’t enabled or started by default: systemctl soon fixes that.
For some bizarre reason, it turned out that although nginx had been configured to use /usr/share/nagios/share and the root directory for PHP scripts, it was trying to access PHP scripts in /etc/nginx/html/nagios. I had to cheat here and just created a symbolic link between the directories which got the basic page displaying.
But then to get the CGI scripts running I had to look more closely at the Arch nginx configuration for fcgiwrap and having seen that the fcgiwrap service wouldn’t run, I finally twigged that nginx was referring to a .sock file and that there was a systemd socket file.
So I now have Nagios running on Arch. Mostly.
Tomorrow I need to figure out the cause of these errors:
Error: Could not read object configuration data!
But at least we’re now dealing with Nagios problems rather than Arch.
Places of interest
- https://wiki.archlinux.org/index.php/nagios – but try_files should read
- https://serverfault.com/questions/517190/nginx-1-fastcgi-sent-in-stderr-primary-script-unknown/517207#517207 – showed the nginx log_format that showed the weird path being used for the php scripts
- https://www.linuxsecrets.com/archlinux-wiki/wiki.archlinux.org/index.php/Nginx.html – gave the little clue about enabling and starting the fcgiwrap socket