Page 1 of 1

Need help with FILE2SOCK

Posted: Wed Oct 18, 2017 8:57 am
by jspence
Hello,

I am trying to output data to file, then read it into the database. Here is what I have done so far.
I modified the ndo2db.cfg file so it would send data to ndo.dat and that worked. Now I am trying to get the data from the .dat file into the MySQL database. I tried the following command:

./file2sock -s /usr/local/nagios/var/ndo.dat -d /usr/local/nagios/var/ndo.sock -p 5668

It seems to execute but nothing shows up in the database.

Any help would greatly be appreciated.
Thanks,
Jeff.

Re: Need help with FILE2SOCK

Posted: Wed Oct 18, 2017 3:59 pm
by cdienger
Hi Jeff,

Is there anything of interest in /usr/local/nagios/var/ndo2db.debug ? You'll need to edit /usr/local/nagios/etc/ndo2db.cfg and set the debug and debug_verbosity if they are not already set.

Re: Need help with FILE2SOCK

Posted: Wed Oct 18, 2017 6:34 pm
by tacolover101
i'm not sure if this is the best place for support for this...

with that said though, what are the contents of ndo.dat?

Re: Need help with FILE2SOCK

Posted: Thu Oct 19, 2017 10:04 am
by jspence
Hello all,
I have debug_level=-1 and debug=verbosity=1 don't have a "debug" attribute.
I attached my ndo.dat.
There isn't anything in ndo2db.debug.
I have ran "watch ipcs -q" on one terminal window to watch the message queue.
Then in another terminal window I executed:

./file2sock -s /usr/local/nagios/var/ndo.dat -d /usr/local/nagios/var/ndo.sock

I can see:
owner: nagios
used-bytes 1403904
messages: 1284
for example. So it is trying to work. I haven't found a way to watch ndo.sock.
I tried: nc -lU ndo.sock but I get an error: nc:Address already in use.
Not sure what to try next.

Thanks,
Jeff.

Re: Need help with FILE2SOCK

Posted: Thu Oct 19, 2017 11:06 am
by jspence
Hello again,

I'm getting data in the database now.
The problem was when I attempted to restart ndo2db (via script) I was only starting ndo2db.
Once I stopped ndo2db, then started it again file2sock put data into the db.

Thanks,
Jeff.

Re: Need help with FILE2SOCK

Posted: Thu Oct 19, 2017 11:47 am
by cdienger
Thanks for the update! Are we okay to lock the thread at this point?

Re: Need help with FILE2SOCK

Posted: Thu Oct 19, 2017 12:43 pm
by jspence
Yes please.