SEND_NSCA mimic login method

nagios at mm.quex.org nagios at mm.quex.org
Mon Nov 8 08:18:14 CET 2004


On Mon, Nov 08, 2004 at 05:25:15PM +1100, Michal Polonski wrote:

> I am trying to use passive checks to be able to send events to
> nagios.. not i know send_nsca can do this , but I'm trying to mimick
> its functionality and do it myself.. 
> 
> I have only got as far as connecting to the socket using hostIP and
> Port, but my question is: how do I authenticate to the nagios server?
> - do I send a passsword in a string formatted in a certain way upon
> connecting? what's the syntax? 
> 
> Searched the net, no help... can anyone here help? 

Nagios itself doesn't listen on a network socket for remote commands.
It reads its instructions from a FIFO on the local filesystem; another
program may listen on a network socket to receive commands, check them
for validity / security, and write them to the FIFO for Nagios.

So, there's two things you might be connecting to:

1) the HTTP server.
2) a nsca daemon.
3) something else entirely.

For #2, your best bet for documentation is to look at the source of
the nscad and send_nsca programs to see how they handle their
encryption and stuff.

For #1, your best bet is to find another way of doing what you're
trying to do. ;)  If not, then you'll have learn about the HTTP
specification.  Authentication is handled by the web server, not
by Nagios; most configurations just use Basic Auth, which is a
part of the HTTP standard and you can read all about it in the
appropriate RFC.  Alternatively, you could use a packet capture
program to see what a client sends to the server (assuming you're
not using SSL).

For #3, you'll have to provide more information about exactly
what it is you're connecting to.  You could fairly easily write
your own program to collect commands using whatever authentication
scheme you feel is needed.


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list