After the installation I can’t visualize the smokeping via the web, I always get the page not found error, but in the cli status I have it working, I’m using nginix web server!
Can anyone help to resolve this?
● smokeping.service - Latency Logging and Graphing System
Loaded: loaded (/lib/systemd/system/smokeping.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2022-09-29 17:23:56 WAT; 43min ago
Docs: man:smokeping(1)
file:/usr/share/doc/smokeping/examples/systemd/slave_mode.conf
Process: 87496 ExecStart=/usr/sbin/smokeping --pid-dir=/run/smokeping (code=exited, status=0/SUCCESS)
Main PID: 87506 (/usr/sbin/smoke)
Tasks: 1 (limit: 77089)
Memory: 35.9M
CPU: 582ms
CGroup: /system.slice/smokeping.service
└─87506 “/usr/sbin/smokeping [FPing]”
Sep 29 17:23:55 ubuntu systemd[1]: Starting Latency Logging and Graphing System…
Sep 29 17:23:56 ubuntu smokeping[87496]: Starting syslog logging
Sep 29 17:23:56 ubuntu smokeping[87496]: Note: logging to syslog as local0/info.
Sep 29 17:23:56 ubuntu smokeping[87496]: Daemonizing /usr/sbin/smokeping …
Sep 29 17:23:56 ubuntu smokeping[87506]: Smokeping version 2.007003 successfully launched.
Sep 29 17:23:56 ubuntu smokeping[87506]: Not entering multiprocess mode for just a single probe.
Sep 29 17:23:56 ubuntu smokeping[87506]: FPing: probing 1 targets with step 300 s and offset 255 s.
Sep 29 17:23:56 ubuntu systemd[1]: Started Latency Logging and Graphing System.
There is no smokeping config in that librenms.vhost file - click the link on my last post - looks like the generic doco, but it has the target link to take you to the right section:
One the website Smokeping - LibreNMS Docs there is an error in the description of how to run it at least under debian 11
On the website it is described that you should follow these steps
Note, you need to install fcgiwrap for CGI wrapper interact with Nginx
apt install fcgiwrap
Then configure Nginx with the default configuration
cp /usr/share/doc/fcgiwrap/examples/nginx.conf /etc/nginx/fcgiwrap.conf
Add the following configuration to your /etc/nginx/conf.d/librenms config file.
The following will configure Nginx to respond to http://yourlibrenms/smokeping:
Browsing to http://yourlibrenms/smokeping/ should bring up the smokeping web interface
the first is that the file in /etc/nginx/conf.d/librenms should have a conf ending because in the main nginx configuration it is set as default that it imports *.conf files
However, after renaming to librenms.conf nginx -t returns
nginx -t
nginx: [emerg] "location" directive is not allowed here in /etc/nginx/conf.d/librenms.conf:3
nginx: configuration file /etc/nginx/nginx.conf test failed
root@nms:/etc/nginx/conf.d# mcedit /etc/nginx/conf.d/librenms.conf
and this is as correct as possible because we should put the location directive in the main vhost file for libre nms
The solution is not to put anything in the /etc/nginx/conf.d/librenms file or librenms.conf
and putting in the vhost configuration file for librenms in my case the file looks like this
cat /etc/nginx/sites-available/librenms.vhost
server {
server_name nms.host.pl;
root /opt/librenms/html;
index index.php;
charset utf-8;
gzip on;
gzip_types text/css application/javascript text/javascript application/x-javascript image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon;
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_send_timeout 300;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location /api/v0 {
try_files $uri $uri/ /api_v0.php?$query_string;
}
location ~ \.php {
include fastcgi.conf;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
}
location ~ /\.ht {
deny all;
}
location = /smokeping/ {
fastcgi_intercept_errors on;
fastcgi_param SCRIPT_FILENAME /usr/lib/cgi-bin/smokeping.cgi;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param HTTPS $https if_not_empty;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
}
location ^~ /smokeping/ {
alias /usr/share/smokeping/www/;
index smokeping.cgi;
gzip off;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/nms.host.pl/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/nms.host.pl/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}server {
if ($host = nms.host.pl) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name nms.host.pl;
return 404; # managed by Certbot
}
I’m having a hard time reading your reply and of course having issues with smokeping. What do you mean by this?
Add the following configuration to your /etc/nginx/conf.d/librenms config file.
The following will configure Nginx to respond to http://yourlibrenms/smokeping:
Browsing to http://yourlibrenms/smokeping/ should bring up the smokeping web interface