Need help with FILE2SOCK

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.
Locked
jspence
Posts: 28
Joined: Wed Jan 11, 2017 1:23 pm

Need help with FILE2SOCK

Post 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.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Need help with FILE2SOCK

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

Re: Need help with FILE2SOCK

Post 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?
jspence
Posts: 28
Joined: Wed Jan 11, 2017 1:23 pm

Re: Need help with FILE2SOCK

Post 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.
jspence
Posts: 28
Joined: Wed Jan 11, 2017 1:23 pm

Re: Need help with FILE2SOCK

Post 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.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Need help with FILE2SOCK

Post by cdienger »

Thanks for the update! Are we okay to lock the thread at this point?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
jspence
Posts: 28
Joined: Wed Jan 11, 2017 1:23 pm

Re: Need help with FILE2SOCK

Post by jspence »

Yes please.
Locked