How to install NagiosQl on Arch Linux
pacman -Syu
pacman -S mariadb php
mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
systemctl enable --now mariadb.service
mariadb-secure-installation
mariadb -u root -p
CREATE USER 'nagiosql'@'localhost' IDENTIFIED BY 'PASSWORD';
CREATE DATABASE nagiosql;
GRANT ALL PRIVILEGES ON nagiosql.* TO 'nagiosql'@'localhost';
FLUSH PRIVILEGES;
quit
Edit /etc/php/php.ini
to include the following:
extension=gettext
extension=mysqli
extension=pdo_mysql
extension=ftp
Restart php-fpm
systemctl restart php-fpm.service
yay -S php-pear
Edit /etc/php/php.ini
to include the following:
open_basedir=...:/usr/lib/php
Install ssh2
pecl install ssh2
Edit /etc/php/php.ini
to include the following:
extension=ssh2.so
include_path = ".:/usr/share/pear"
Restart php-fpm
systemctl restart php-fpm.service
Get the latest version from https://sourceforge.net/projects/nagiosql/
wget https://sourceforge.net/projects/nagiosql/files/nagiosql/NagiosQL%203.5.0/nagiosql-3.5.0-git2023-06-18.tar.gz/download -o nagiosql-3.5.0.tar.gz
tar -xzf nagiosql-3.5.0.tar.gz
Move files into place, put contents of nagiosql-3.5.0.tar.gz
to nginx root, in this case /srv/nagiosql
mv nagiosql-3.5.0 /usr/share/nagios/share/webadmin
mkdir /etc/nagiosql
Fix permissions
chown -R http:http /srv/nagiosql
chmod 775 /srv/nagiosql
chown -R http:nagios /etc/nagiosql
chmod -R 775 /etc/nagiosql
chown -R http:nagios /etc/nagios/nagios.cfg
chown -R http:nagios /etc/nagios/cgi.cfg
chown -R http:nagios /var/nagios/rw/nagios.cmd
chmod 640 /etc/nagios/nagios.cfg
chmod 640 /etc/nagios/cgi.cfg
chmod 660 /var/nagios/rw/nagios.cmd
Edit /etc/php/php.ini
to include the following:
open_basedir=...:/etc/nagios/:/var/nagios/:/etc/nagiosql
Edit /etc/php/php-fpm.d/www.conf
to include the following:
php_admin_value[open_basedir]=...:/srv/nagiosql:/etc/nagios/:/var/nagios/:/etc/nagiosql
Make php-fpm be able to write to /etc (I dont know if this is the best option!!!)
systemctl edit php-fpm
[Service]
ReadWritePaths=/etc/nagios /var/nagios
systemctl daemon-reexec
systemctl restart php-fpm