openbsd-ports/net/smokeping/pkg
ajacoutot c4096e6659 Stop using the daemon class in @newuser.
If we need to make an exception we can do it and properly document the
reason but by default we should just use the default login class.
rc.d uses daemon or the login class provided in login.conf.d so this has
no impact there.

discussed with sthen@, tb@ and robert@

praying that my grep/sed skills did not break anything and still
believing in portbump :-)
2022-11-08 11:16:56 +00:00
..
DESCR
PLIST Stop using the daemon class in @newuser. 2022-11-08 11:16:56 +00:00
README
smokeping_fcgi.rc
smokeping.rc

+-----------------------------------------------------------------------
| Running ${PKGSTEM} on OpenBSD
+-----------------------------------------------------------------------

Basic configuration
===================
Smokeping is split into two main parts, the daemon (running the probes
and updating RRD files) and the part responsible for generating website
graphs.

For the daemon, edit ${SYSCONFDIR}/config (at least add some hosts to
monitor) and enable it:

    rcctl enable smokeping
    rcctl start smokeping

For graph generation, the simplest method is generate static HTML
and image files from a cron job. This doesn't allow zoom into graphs
interactively from the browser, but it is easy to configure, more
secure, and is good enough for many use cases. To do this, add a cron
job to run this as the _smokeping user (adjust path as necessary):

    smokeping --static=/var/www/htdocs/smokeping

Alternatively it can run as a CGI/FastCGI script with a web server.
A normal installation runs smokeping_fcgi as a daemon and the web
server is told to communicate with it over a UNIX socket.
If you wish to use this method, enable the daemon:

    rcctl enable smokeping_fcgi
    rcctl start smokeping_fcgi

And configure your web server to access it - here is a sample
configuration section for use with nginx:

    location ~ /smokeping/smokeping.cgi$ {
	fastcgi_pass	unix:run/smokeping.sock;
	fastcgi_split_path_info ^(/cgi-bin/[^/]+)(.*);
	fastcgi_param	PATH_INFO $fastcgi_path_info;
	fastcgi_param	SCRIPT_FILENAME $fastcgi_script_name;
	include		fastcgi_params;
    }

Or httpd(8):

    server "example.org" {
	listen on * port 80
	location "/smokeping/smokeping.cgi*" {
	    fastcgi socket "/run/smokeping.sock"
	    root "/"
	}
    }

Other probe types
=================
Smokeping is most often used to perform ICMP monitoring via fping,
but has "Probe" modules for other protocols too. Some of these require
additional packages to be installed:

 RADIUS:	   p5-Authen-Radius
 TelnetIOSPing:	   p5-Net-Telnet
 OpenSSHEOSPing:   p5-Net-OpenSSH p5-IO-Pty
 OpenSSHJunOSPing: p5-Net-OpenSSH p5-IO-Pty
 AnotherDNS:	   p5-Net-DNS
 LDAP:		   p5-ldap p5-IO-Socket-SSL

Advanced topic: Heavy load systems
==================================
If problems are seen with excessive load or i/o, it is possible to
configure Smokeping to use rrdcached instead. Read through the whole
section before starting; this is *not* needed for a typical setup.

To do this, group permissions should be set to allow Smokeping to
access the rrdcached socket, and to allow rrdcached to access
Smokeping's files, e.g.:

	$ grep _smokeping /etc/group
	_smokeping:*:562:_rrdcached
	_rrdcached:*:726:_smokeping

	# chgrp -R _rrdcached /var/db/smokeping
	# chmod -R g+w /var/db/smokeping

The rrdcached daemon must be running:

	# rcctl enable rrdcached
	# rcctl set rrdcached flags -b /var/db/smokeping -B -m 770 \
	    -l unix:/var/run/rrd/rrdcached.sock -j /var/db/smokeping/journal \
	    -p /var/run/rrd/rrdcached.pid
	# rcctl restart rrdcached

Smokeping must be told to use the daemon. This is done by setting an
environment variable; add this to /etc/login.conf:

smokeping:setenv=RRDCACHED_ADDRESS=unix\c/var/run/rrd/rrdcached.sock:tc=daemon

The Smokeping FastCGI script must also be told to use the daemon.
This is done by setting the variable in your web server. For nginx:

fastcgi_param  RRDCACHED_ADDRESS unix:/var/run/rrd/rrdcached.sock;

Then restart smokeping and smokeping_fcgi. Use -d to show more information
in case of errors at startup.

	# rcctl -d restart smokeping
	# rcctl -d restart smokeping_fcgi