Nagios and NSCA (for Munin)

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: Nagios and NSCA (for Munin)

Post by gshergill »

Hi scottwilkerson,

Sorry for the very long delay in a reply, I had a slight incident but am back at working now and back on NMS solutions.

So, to where we left off, I ran the command you suggested and the following is now my output;

Code: Select all

root@muninnagios:~# /usr/sbin/send_nsca -H nagios -p 5667 -c /etc/send_nsca.cfg 
Error: Server closed connection before init packet was received
Error: Could not read init packet from server
The xinetd and nsca services were restart to ensure they were up to date with the latest changes.

I was wondering, is the plugin for nagios required for this step to work? Or does that come after all of this?

Thanks.

Kind Regards,

gshergill
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios and NSCA (for Munin)

Post by scottwilkerson »

How about running the following to simulate a host check...

Code: Select all

echo -e "HOST\t0\tOK"|/usr/sbin/send_nsca -H nagios -p 5667 -c /etc/send_nsca.cfg 
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: Nagios and NSCA (for Munin)

Post by gshergill »

Hi scottwilkerson,

Unfortunately, the same error is cropping up with that command (wasn't sure to use muninnagios or nagios for the HOST);

Code: Select all

root@muninnagios:/usr/share/munin/plugins# echo -e "muninnagios\t0\tOK"|/usr/sbin/send_nsca -H nagios -p 5667 -c /etc/send_nsca.cfg
Error: Server closed connection before init packet was received
Error: Could not read init packet from server

root@muninnagios:/usr/share/munin/plugins# echo -e "nagios\t0\tOK"|/usr/sbin/send_nsca -H nagios -p 5667 -c /etc/send_nsca.cfg
Error: Server closed connection before init packet was received
Error: Could not read init packet from server
Also tried with IP addresses, but the same issue.

Thanks again for a quick response.

Kind Regards,

gshergill
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios and NSCA (for Munin)

Post by scottwilkerson »

Can you use the IP for the nagios server to see if that makes a difference, ie

Code: Select all

echo -e "muninnagios\t0\tOK"|/usr/sbin/send_nsca -H XXX.XXX.XXX.XXX -p 5667 -c /etc/send_nsca.cfg
If you get the same result, lets make sure that on the XI server you have the following file

Code: Select all

/etc/xinetd.d/nsca
And that xinetd is running

Code: Select all

service xinetd status
If so, lets look at the following log while trying to send from the remote server

Code: Select all

tail -f /var/log/messages
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: Nagios and NSCA (for Munin)

Post by gshergill »

Hi scottwilkerson,

I feel a bit stupid now, but it seems that when I rolled back on the snapshot of the server, I totally forgot to change the /etc/xinetd.d/nsca file back to the edited...

Long story short, the command works now;

Code: Select all

root@muninnagios:/usr/share/munin/plugins# echo -e "muninnagios\t0\tOK" | /usr/sbin/send_nsca -H nagios -p 5667 -c /etc/send_nsca.cfg
1 data packet(s) sent to host successfully.
Do I still need to run the tail command?

Also, without the echo part it is back to this error if it helps;

Code: Select all

root@muninnagios:/usr/share/munin/plugins# /usr/sbin/send_nsca -H nagios -p 5667 -c /etc/send_nsca.cfg
Error: Timeout after 10 seconds
Thanks again! Nearly there I hope =)

Kind Regards,

gshergill
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios and NSCA (for Munin)

Post by scottwilkerson »

That should do it.

You need the echo part (or pipe NSCA the data) otherwise it has nothing to send.

The result

Code: Select all

1 data packet(s) sent to host successfully.
Means that the data was sent to the server....
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: Nagios and NSCA (for Munin)

Post by gshergill »

Hi scottwilkerson,

Thanks for the help, am glad the check command is working now.

So continuing on the guide I am using up to the end and seems ok.
I downloaded the plugin located at;

http://exchange.nagios.org/directory/Pl ... rd/details

I checked and had to edit the path to the correct plugin folder (for finding utils.pm).

So, running the command shown below results in an error;

Code: Select all

root@nagios:/usr/local/nagios/etc/# ../libexec/check_munin_rrd.pl -H grumbler -d <domain> -M df -w 80 -c 95
No such directory /var/lib/munin/<domain>
So, checking the muninnagios machine there exists a folder;

/var/lib/munin/<domain>

which contains everything about the host grumbler (including sensor data, temp, voltage, etc).

It seems therefore, that it is searching on my Nagios machine for the folder... I assume I'm missing something...

Thanks.

Kind Regards,

gshergill
Last edited by gshergill on Thu Oct 04, 2012 8:23 am, edited 1 time in total.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios and NSCA (for Munin)

Post by scottwilkerson »

A brief glance through this plugin, and I don't believe it connects to the munin server, I believe it is supposed to be run ON the munin server.

This would make sense why your guide was having you setup NSCA whuch would allow you to execute this on the munin server and return the results through NSCA.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: Nagios and NSCA (for Munin)

Post by gshergill »

Hi scottwilkerson,

That seems a bit confusing to me... So I just need to put the plugin on the Munin server? Does it need nagios or anything installed on it first though?

Sorry I'm just having a bit of trouble understanding how Munin sends it to Nagios via the plugin being on the Munin server.

Thanks again.

Kind Regards,

gshergill
Last edited by gshergill on Thu Oct 04, 2012 8:25 am, edited 1 time in total.
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: Nagios and NSCA (for Munin)

Post by gshergill »

Hi scottwilkerson,

Before that, there appears to be something wrong with my Nagios XI server.

Going into core config manager I can see everything (all services, commands, hosts).

But on the standard page, Host Detail says;

Code: Select all

No matching host found
Service Detail says the same thing.

Hostgroups shows the groups, but they are all empty.

Any idea what's going on please? =/

(restarting Nagios XI didn't help, but on the plus side the config check shows x number of each passing).

Thank you.

Kind Regards,

gshergill

EDIT: IGNORE this please, it's fixed. After spending some time trying to find out why, searching these forums found me the answer. Database Corruption. It's okay now.
Locked