Fix for livestatus icw nagios 4

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.
wfournier
Posts: 7
Joined: Fri Oct 04, 2013 2:44 am

Fix for livestatus icw nagios 4

Post by wfournier »

I got frustrated about this issue and fixed it the dirty way.
I'm not sure if this 100% works, but I do see the services and hosts in multisite.

git clone git://git.op5.org/nagios/livestatus.git

diff -Naur livestatus/src/TableHosts.cc livestatus.working/src/TableHosts.cc
--- livestatus/src/TableHosts.cc 2013-11-21 16:12:05.138951539 +0100
+++ livestatus.working/src/TableHosts.cc 2013-11-21 16:05:07.185093055 +0100
@@ -256,6 +256,9 @@
table->addColumn(new DownCommColumn(prefix + "comments_with_info",
"A list of all comments of the host with id, author and comment", indirect_offset, false, true));

+ table->addColumn(new DownCommColumn(prefix + "comments_with_extra_info",
+ "A list of all comments of the host with id, author, comment, entry type and entry time", indirect_offset, false, true));
+
table->addColumn(new CustomVarsColumn(prefix + "custom_variable_names",
"A list of the names of all custom variables", (char *)(&hst.custom_variables) - ref, indirect_offset, CVT_VARNAMES));
table->addColumn(new CustomVarsColumn(prefix + "custom_variable_values",
diff -Naur livestatus/src/TableServices.cc livestatus.working/src/TableServices.cc
--- livestatus/src/TableServices.cc 2013-11-21 16:12:05.138951539 +0100
+++ livestatus.working/src/TableServices.cc 2013-11-21 16:10:27.046093469 +0100
@@ -369,6 +369,9 @@
table->addColumn(new DownCommColumn(prefix + "comments_with_info",
"A list of all comments of the service with id, author and comment", indirect_offset, false, true));

+ table->addColumn(new DownCommColumn(prefix + "comments_with_extra_info",
+ "A list of all comments of the service with id, author, comment, entry type and entry time", indirect_offset, false, true));
+
if (add_hosts)
g_table_hosts->addColumns(this, "host_", (char *)(&svc.host_ptr) - ref);
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Fix for livestatus icw nagios 4

Post by lmiltchev »

Thanks for the feedback!
Be sure to check out our Knowledgebase for helpful articles and solutions!
wfournier
Posts: 7
Joined: Fri Oct 04, 2013 2:44 am

Re: Fix for livestatus icw nagios 4

Post by wfournier »

I also wrote a diff for the 1.2.3i6 version. It's attached.
I tried to clean it up a bit, so all the 2012->2013 stuff is out. It compiles and runs for me.
- patch the tree
- run autoreconf -s;automake --add-missing
- I ran configure with: ./configure CPPFLAGS="-I`pwd`/nagios-400/include/ -I`pwd`/nagios-400"
Attachments
livestatus-1.2.3i6_400.diff.txt
patch
(635.03 KiB) Downloaded 521 times
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Fix for livestatus icw nagios 4

Post by tmcdonald »

I think lmiltchev said it best:
lmiltchev wrote:Thanks for the feedback!
Former Nagios employee
shodg001
Posts: 19
Joined: Wed Oct 23, 2013 5:18 am

Re: Fix for livestatus icw nagios 4

Post by shodg001 »

I also wrote a diff for the 1.2.3i6 version. It's attached.
I tried to clean it up a bit, so all the 2012->2013 stuff is out. It compiles and runs for me.
- patch the tree
- run autoreconf -s;automake --add-missing
- I ran configure with: ./configure CPPFLAGS="-I`pwd`/nagios-400/include/ -I`pwd`/nagios-400"
Hello,

What do I do with the diff .txt file you attached?

Regards,

Shawn
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Fix for livestatus icw nagios 4

Post by slansing »

You need to patch the source with that diff, it has a .txt after it so it could be uploaded here, apologies for the confusion.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Fix for livestatus icw nagios 4

Post by scottwilkerson »

For those still who may not be aware, there is an official livestatus version that works with Nagios Core 4 now...

Code: Select all

cd /tmp
wget http://mathias-kettner.com/download/mk-livestatus-1.2.4.tar.gz
tar xzf mk-livestatus-1.2.4.tar.gz
cd mk-livestatus-1.2.4
./configure --with-nagios4
make
make install
This as opposed to the hacked together versions and patches that have been thrown around...
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
tudt949
Posts: 2
Joined: Wed Jul 24, 2013 8:57 am

Re: Fix for livestatus icw nagios 4

Post by tudt949 »

scottwilkerson wrote:For those still who may not be aware, there is an official livestatus version that works with Nagios Core 4 now...

Code: Select all

cd /tmp
wget http://mathias-kettner.com/download/mk-livestatus-1.2.4.tar.gz
tar xzf mk-livestatus-1.2.4.tar.gz
cd mk-livestatus-1.2.4
./configure --with-nagios4
make
make install
This as opposed to the hacked together versions and patches that have been thrown around...
I've try but get same result, not success loading module ... :(

Code: Select all

[1411103342] Nagios 4.0.7 starting... (PID=22761)
[1411103342] Local time is Fri Sep 19 12:09:02 ICT 2014
[1411103342] LOG VERSION: 2.0
[1411103342] qh: Socket '/usr/local/nagios/var/rw/nagios.qh' successfully initialized
[1411103342] qh: core query handler registered
[1411103342] nerd: Channel hostchecks registered successfully
[1411103342] nerd: Channel servicechecks registered successfully
[1411103342] nerd: Channel opathchecks registered successfully
[1411103342] nerd: Fully initialized and ready to rock!
[1411103342] wproc: Successfully registered manager as @wproc with query handler
[1411103342] wproc: Registry request: name=Core Worker 22766;pid=22766
[1411103342] wproc: Registry request: name=Core Worker 22764;pid=22764
[1411103342] wproc: Registry request: name=Core Worker 22765;pid=22765
[1411103342] wproc: Registry request: name=Core Worker 22763;pid=22763
[1411103342] livestatus: Livestatus 1.2.4 by Mathias Kettner. Socket: '/var/lib/nagios/rw/live'
[1411103342] livestatus: Please visit us at http://mathias-kettner.de/
[1411103342] livestatus: Hint: please try out OMD - the Open Monitoring Distribution
[1411103342] livestatus: Please visit OMD at http://omdistro.org
[1411103342] livestatus: Unable to bind adress /var/lib/nagios/rw/live to UNIX socket: No such file or directory
[1411103342] Error: Function nebmodule_init() in module '/usr/local/lib/mk-livestatus/livestatus.o' returned an error.  Module will 
be unloaded.
[1411103342] Event broker module '/usr/local/lib/mk-livestatus/livestatus.o' deinitialized successfully.
[1411103342] Error: Failed to load module '/usr/local/lib/mk-livestatus/livestatus.o'.
[1411103342] Error: Module loading failed. Aborting.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Fix for livestatus icw nagios 4

Post by slansing »

@tydt949,

Can you share your nagios.cfg with us please? So we can take a look at your modules?
tudt949
Posts: 2
Joined: Wed Jul 24, 2013 8:57 am

Re: Fix for livestatus icw nagios 4

Post by tudt949 »

slansing wrote:@tydt949,

Can you share your nagios.cfg with us please? So we can take a look at your modules?
I think this sub of nagios.cfg is correctly to load livestatus module:

Code: Select all

..................
# EVENT BROKER OPTIONS
# Controls what (if any) data gets sent to the event broker.
# Values:  0      = Broker nothing
#         -1      = Broker everything
#         <other> = See documentation
broker_module=/usr/local/lib/mk-livestatus/livestatus.o /var/lib/nagios/rw/live
event_broker_options=-1
..................
Locked