Nagios 4.5.1 - LiveStatus 1.2.8

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Post Reply
delboy1966
Posts: 96
Joined: Thu Oct 22, 2015 5:26 am

Nagios 4.5.1 - LiveStatus 1.2.8

Post by delboy1966 »

I posed this question last year about livestatus and the version, and seems that its no longer being maintained for Nagios.

viewtopic.php?p=344372#p344372

We are now trying to upgrade to Nagios Core 4.5.1, using livestatus version 1.2.8.
Nagios is installed, I've complied Livestatus 1.2.8 and loaded the broker module in nagios.cfg.
Nagios runs fine, but if I trying to query anything my return output is blank. The next time I try I get a connection refused.

I'm using a perl script and this is the line

chomp (@services = `printf 'GET services\n' | /usr/local/bin/unixcat /usr/local/nagios/var/rw/live`);


When I check Nagios I see

# service nagios status
● nagios.service - Nagios Core 4.5.1
Loaded: loaded (/lib/systemd/system/nagios.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2024-04-03 12:59:42 BST; 24min ago
Docs: https://www.nagios.org/documentation
Process: 736764 ExecStartPre=/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg (code=exited, status=0/SUCCESS)
Process: 736778 ExecStart=/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg (code=exited, status=0/SUCCESS)
Process: 737248 ExecStopPost=/usr/bin/rm -f /usr/local/nagios/var/rw/nagios.cmd (code=exited, status=0/SUCCESS)
Main PID: 736779 (code=exited, status=254)

Apr 03 12:59:29 nagda01lv nagios[736764]: Checked 103 timeperiods
Apr 03 12:59:29 nagda01lv nagios[736764]: Checking global event handlers...
Apr 03 12:59:29 nagda01lv nagios[736764]: Checking obsessive compulsive processor commands...
Apr 03 12:59:29 nagda01lv nagios[736764]: Checking misc settings...
Apr 03 12:59:29 nagda01lv nagios[736764]: Total Warnings: 1
Apr 03 12:59:29 nagda01lv nagios[736764]: Total Errors: 0
Apr 03 12:59:29 nagda01lv nagios[736764]: Things look okay - No serious problems were detected during the pre-flight check
Apr 03 12:59:29 nagda01lv systemd[1]: Started Nagios Core 4.5.1.
Apr 03 12:59:42 nagda01lv systemd[1]: nagios.service: Main process exited, code=exited, status=254/n/a
Apr 03 12:59:42 nagda01lv systemd[1]: nagios.service: Failed with result 'exit-code'.


But I can still use the GUI to see statuses of services/hosts.

Has anyone else successfully installed livestatus 1.2.8 with Nagios 4.5.1
User avatar
danderson
Posts: 190
Joined: Wed Aug 09, 2023 10:05 am

Re: Nagios 4.5.1 - LiveStatus 1.2.8

Post by danderson »

Thanks for reaching out @delboy1966,

You say you compiled Livestatus 1.2.8, did you use up to date header files from Nagios 4.5.X?
bbahn
Posts: 217
Joined: Thu Jan 12, 2023 5:42 pm

Re: Nagios 4.5.1 - LiveStatus 1.2.8

Post by bbahn »

@delboy1966,

Some others seem to have resolved the issue of using Nagios Core 4.5.2 with LiveStatus 1.2.8 here: viewtopic.php?p=357063&hilit=livestatus#p357063
Hi,

I managed to fix it as follows:

- download and unpack the livestatus tarball into /tmp
- download and unpack the nagios 4.5.0 core tarball into /tmp

- copy the nagios 4.5.0 header files to the mklivestatus source folder:

cp /tmp/nagios-4.5.0/lib/*.h /tmp/mk-livestatus-1.5.0p24/nagios4/
cp /tmp/nagios-4.5.0/include/*.h /tmp/mk-livestatus-1.5.0p24/nagios4/

Press "y" to overwrite all existing files.

- Edit /tmp/mk-livestatus-1.5.0p24/nagios4/shared.h and change line 5 to look like this:
#include "libnagios.h"

Save the file and return 1 level up.
./configure --with-nagios4
make clean
make
make install

Restart nagios

After that, my Nagios didn't crash anymore when trying to open a Nagvis map.

Hope this helps.

Stijn
Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
Post Reply