Smokeping 404 | Not Found

====================================

Component Version
LibreNMS 22.9.0-14-gf60b6788d
DB Schema 2022_09_03_091314_update_ports_adsl_table_with_defaults (246)
PHP 8.1.10
Python 3.10.6
Database MariaDB 10.6.7-MariaDB-2ubuntu1.1
RRDTool 1.7.2
SNMP 5.9.1

====================================
Hello,

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.

Thanks
Regards

I have the same problem, did you solve it ?

Works out of the box following the doco for me on Ubuntu 18.04, 20.04, and 22.04 - it was a new smokeping installation in my case.

What’s in ~/logs/access_log and error_log when you get the 404?

Did you explicitly copy and paste the nginx config snippets (direct link below) or are there perhaps some errors in it?

Hi,

Follow this tutorial it solves the problem.

https://www.youtube.com/watch?v=Aa8wjA0w8ek&ab_channel=IPCoreNetworks

Hello

I made configuration on Debian 11 (nginx) from Smokeping - LibreNMS Docs

Log file from nginx show

x.x.x.x - - [07/Oct/2022:11:56:27 +0200] “GET /smokeping/ HTTP/1.1” 499 0 “-” "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:105.0) Gecko/20100101 Firefox/105.0

nginx vhost:

cat librenms.vhost
server {
server_name nms.domain.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/php8.1-fpm.sock;
}
location ~ /.ht {
deny all;
}

listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/nms.domain.pl/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/nms.domain.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.domain.pl) {
return 301 https://$host$request_uri;
} # managed by Certbot

listen 80;
server_name nms.domain.pl;
return 404; # managed by Certbot

}

1 Like

Follow through the doco again I’d recommend.

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:

https://docs.librenms.org/Extensions/Smokeping/#nginx-configuration-ubuntu-debian-and-alike

You need the fcgiwrap config and the parts added like below within the existing main server { } block:

# Browsing to `http://yourlibrenms/smokeping/` should bring up the smokeping web interface

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;
...
...
... etc.
...

You’re also getting a 499 error though, not 404, so could be some other issues.

1 Like

Hello

I found problem :slight_smile:

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

location = /smokeping/ {
fastcgi_intercept_errors on;


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

[email protected]:/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


}