Hi everybody,
since I no longer enjoyed (re)starting moni.pl manually, I wrote the following service definition in order to let systemd care for the monitoring process.
$ cat /etc/systemd/system/nedimoni.service
[Unit]
Description=NeDi monitoring daemon for network infrastructure
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=nediusr
ExecStart=/opt/nedi/current/moni.pl
PrivateTmp=yes
Restart=always
RestartSec=180
#StandardError=syslog
IPAccounting=yes
[Install]
WantedBy=multi-user.target
To see that services status in NeDi, I patched System-Services.php as follows.
===================================================================
RCS file: ./RCS/System-Services.php,v
retrieving revision 1.1
diff -u -r1.1 ./System-Services.php
--- ./System-Services.php 2018/01/22 11:17:41 1.1
+++ ./System-Services.php 2018/01/22 11:29:04
@@ -134,6 +134,12 @@
</tr>
</table>
<p>
+<h2>systemd moni status</h2>
+<div class="textpad code pre txta tqrt">
+$ systemctl status -l nedimoni.service
+<?= shell_exec('systemctl status -l nedimoni.service') ?>
+
+</div><br>
<h2><?= $cmdlbl ?></h2>
Hope this helps!
Gerold