[Xymon] Anyone have a good systemd script they would like to share?

david.gore at verizon.com david.gore at verizon.com
Thu May 31 16:56:02 CEST 2018


I have created the following systemd file. This works to stop/start/restart/status/reload xymon except for dbcheck.

I see this in the logs and dbcheck fails to connect to any DB instance:

Thu May 31 13:49:19 2018:ERROR: ORA-12154: TNS:could not resolve the connect identifier specified (DBD ERROR: OCIServerAttach)

I also created a global environment file which didn't help. /home/xymon/server/bin/xymon.sh always works, systemctl restart xymon always fails to have dbcheck.pl to work as expected.

Perhaps I should be using something else to monitor Oracle instances? The script is available here, if you are not aware of dbcheck.pl.

https://sourceforge.net/projects/hobbit-perl-cl/

Anyone using dbcheck.pl with a systemd stop/start file?

[xymon at xymon1 ext]$ cat /etc/profile.d/oracle_env.sh

ORACLE_HOME=/usr/lib/oracle/12.2/client64
TNS_ADMIN=/home/xymon/server/ext/impact/db/etc
PATH=$ORACLE_HOME/bin:$PATH

if test "$LD_LIBRARY_PATH" = ""
then
        LD_LIBRARY_PATH=$ORACLE_HOME/lib
else
        LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
fi

export LD_LIBRARY_PATH ORACLE_HOME TNS_ADMIN PATH

[xymon at xymon1 tmp]$ cat /etc/centos-release
CentOS Linux release 7.5.1804 (Core)

[xymon at xymon1 tmp]$ cat /etc/systemd/system/xymon.service

[Unit]
Description=Xymon Monitoring Service
After=network.target

[Service]
Type=forking
User=xymon
ExecStart=/home/xymon/server/bin/xymon.sh start
ExecStop=/home/xymon/server/bin/xymon.sh stop
ExecReload=/home/xymon/server/bin/xymon.sh reload
Restart=on-failure
RestartSec=42s

[Install]
WantedBy=multi-user.target


David W Gore
Global Surveillance Production Support (GSPS)
O: +1 919-378-3676 M: +1 919-200-3263
SMS: mailto:9192003263 at vzwpix.com
email: gsps at verizon.com





More information about the Xymon mailing list