Logfiles for components (issue with autodiscovery)

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
BulletByte
Posts: 2
Joined: Fri Jan 31, 2014 6:28 am

Logfiles for components (issue with autodiscovery)

Post by BulletByte »

Hi all,
i downloaded the NagiosXI virtual machine, it is up and running. I also executed the autodiscovery shell script and tried to run it.
A job is created (simple /24 subnet) but the status is never updated, each refresh shows always "in progress". I tried a single IP address, the same result. The single IP is reachable with fping.

My questions(s):

1) Does the autodiscovery component has a logfile? I tried the nagios.log and some others i found, but it seems there are only general messages inside the nagios.log about the service itself.
2) Is there a generic way on how to get logfiles from plugins/components/wizards p.e. executed cmd line, return codes/strings, whatever...
3) I tried to have a look on how the php files for this software executes the code for autodiscovery, but bcause i am more or less a newbie in nagios xi i have no clue whats going on there and how (no, where) to add a little piece of code to generate the logfile by myself if thats the solution.

Ok guys, thx i.a.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Logfiles for components (issue with autodiscovery)

Post by sreinhardt »

There are some changes that really need to be made to the autodiscovery wizard, and you have hit one of the largest, it's potential slowness. There really isn't a log file that it maintains, likely what has happened is that one or more of your hosts, while up, are extremely slow to respond to the scan being run against them and thus causing autodiscovery to be slow.

2) What exactly are you looking for? Nagios itself isn't able to directly run winpe files as it is a linux system, and most of the output for other binaries are just sent directly back to the nagios core engine as they are intended to be very quick checks.

3) the code for autodiscovery is a bit messy too, you are welcome to have a look. It's located at /usr/local/nagiosxi/html/includes/wizards/autodiscovery/
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
BulletByte
Posts: 2
Joined: Fri Jan 31, 2014 6:28 am

Re: Logfiles for components (issue with autodiscovery)

Post by BulletByte »

Hi Spenser,
thx for your reply. The VM is located in the same subnet /24 as all the other hosts (~25/254), including 2 linux boxes (2x VM), 1 Switch with http interface, 2 routers with http and ssh and all other are Windows 7 machines + 2008 R2 servers. No hops between, icmp reply time is nothing to think about here... i found the "no OS detection" setting but no effect. nmap itself is as fast as you know it, so i hoped some logfiles would help me to find the issue or at least a specific host or something else :)

So if i understand it right this is a known issue and the road to a real bug must still be found.

to (2)
winpe files? I know WinPE but i think thats not what youre talking about...? I thought that its possible to have a (global?) config parameter to enable debug logging for the 1001 million plugins, check_scripts and so on... or some debugging on component/plugin level itself. And yes the VM is running with CentOS linux, its the official "try before buy" VM which i want to evaluate for all enterprise projects (nagios xi, and other potential solutions), downloaded yesterday ;)

to (3)
messy code... well... i had already a look on it and its not that messy in my opinion, its a php/html mix ok, but not that messy. I progged a lot of code in the past looking even "messier" (whatever the right word is, sorry for my english) :lol: I hoped to find a line like $mycmdline = 'fancy_nmap_cmd_line_with_args' to extend it and pipe out the output to a simpe textfile and another line telling me which object is in progress now. But there are a lot of things going on in these pluging and its hard to find the right entry point if you have never handled nagios code :roll:

Ok lot of words... what could i do? With no debugging option i cannot help to make things going smooth ;) Any hints?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Logfiles for components (issue with autodiscovery)

Post by sreinhardt »

Unfortunately, it's not an issue with nmap at all, but more to do with the choice of implementation for it within our code. I think I already said there is an internal bug report already for it. We know what it is, its just a matter of fixing and updating the wizard.

There is not a global enable debugging. Each plugin would have to support it, and many do not have any form of real debugging, much less logging. Probably the closest you would get, would be to add a -v for verbose flag to some plugins, but again its not really a standard within the plugin development area. Looking back, I'm not quite sure why I was referring to WinPE stuff... not enough coffee I suppose. :D

I would say the wizard for autodiscovery is less specific to nagios code, but agreed there is quite a lot going on inside it. I think before digging into the code we should discuss what you are looking to get out of autodiscovery. If you are purely looking for a bulk way to add hosts, it does a good job. However presently it does not pull in other wizards such as the windows monitoring wizard when a windows host is discovered so it may be of limited use compared to your initial thought.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked