Fix for livestatus icw nagios 4
Fix for livestatus icw nagios 4
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);
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);
Re: Fix for livestatus icw nagios 4
Thanks for the feedback!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Fix for livestatus icw nagios 4
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"
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
Re: Fix for livestatus icw nagios 4
I think lmiltchev said it best:
lmiltchev wrote:Thanks for the feedback!
Former Nagios employee
Re: Fix for livestatus icw nagios 4
Hello,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"
What do I do with the diff .txt file you attached?
Regards,
Shawn
-
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Fix for livestatus icw nagios 4
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.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Fix for livestatus icw nagios 4
For those still who may not be aware, there is an official livestatus version that works with Nagios Core 4 now...
This as opposed to the hacked together versions and patches that have been thrown around...
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
Re: Fix for livestatus icw nagios 4
I've try but get same result, not success loading module ...scottwilkerson wrote:For those still who may not be aware, there is an official livestatus version that works with Nagios Core 4 now...
This as opposed to the hacked together versions and patches that have been thrown around...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
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.
-
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Fix for livestatus icw nagios 4
@tydt949,
Can you share your nagios.cfg with us please? So we can take a look at your modules?
Can you share your nagios.cfg with us please? So we can take a look at your modules?
Re: Fix for livestatus icw nagios 4
I think this sub of nagios.cfg is correctly to load livestatus module:slansing wrote:@tydt949,
Can you share your nagios.cfg with us please? So we can take a look at your modules?
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
..................