Page 2 of 2

Re: NagFlux on Nagio/with Nagios

Posted: Wed Dec 13, 2017 10:20 am
by vnuna
So how should I run what's after #!/bin/bash because it gives me an erro if I just simply run the shebang command. After I enter #vi it takes to edit the file, I right click it shows shebang command, but returns an error. If I ran the below /bin/cp command on the root that works okay, but only when I quit from running after shebang otherwise it stays in vi mode.

The scripts are necessary to write performance data to pnp4nagios and nagflux.
# vi /usr/local/nagios/libexec/process-host-perfdata-file-bulk
#!/bin/bash

/bin/cp -p /usr/local/nagios/var/host-perfdata /usr/local/nagios/var/spool/nagfluxperfdata/${1}.perfdata.host
/bin/mv /usr/local/nagios/var/host-perfdata /usr/local/nagios/var/spool/xidpe/${1}.perfdata.host


My question again comes to if I have Nagflux sitting on Win10, how it will know to access NagiosSpoolfileFolder. or Do I have to set a cronjob to transmit the data from NagiosXi to this directory, but I am unable to locate the directory within Windows. I am sounding dumb here when it comes to transmit data between windows and linux via command.

Re: NagFlux on Nagio/with Nagios

Posted: Wed Dec 13, 2017 10:40 am
by mcapra
vnuna wrote: My question again comes to if I have Nagflux sitting on Win10, how it will know to access NagiosSpoolfileFolder.
I would think the easiest way would be to chuck it in a samba share (on the Linux side of things) then point your Windows-side NagFlux configuration at that shared path. A samba share works almost exactly like a "shared folder" or network drive as far as Windows is concerned. Plenty of guides online for getting that all setup:
https://www.tecmint.com/install-samba4- ... n-windows/

So even though the files don't physically exist on the Windows machine, you could access them via a shared folder.

The NagFlux configuration on the Windows side of things then might be configured like so:

Code: Select all

NagiosSpoolfileFolder = "\\my.nagios.host\path\to\samba\share"
If you were using a regular network path and didn't mount the remote samba share as a drive or something.

I'm not saying that's the most performant solution to this problem (it's absolutely not), but that is the easiest most well-documented way to get files from a Linux machine to a Windows machine generally.

This is all quite a bit out of scope for regular "Nagios XI" stuff though and literally the only reason I know anything about NagFlux is having previously played around with it.

Re: NagFlux on Nagio/with Nagios

Posted: Wed Dec 13, 2017 4:10 pm
by dwhitfield
Thanks @mcapra!

At this time, I believe the only third-party graphing component we support is cacti. Instructions for setting that up are available at https://assets.nagios.com/downloads/nag ... ide_XI.pdf

Of course, we can leave this open for community input. I'm sure if you get it going others would benefit from knowing how you made it work.

Re: NagFlux on Nagio/with Nagios

Posted: Thu Dec 14, 2017 11:22 am
by vnuna
Thanks @mcapra, I took your suggestion into consideration of "not a most performant solution", I went and installed Nagflux on the Nagios linux machine. Configured the Nagflux, with all configs as mentioned on the article/instructions and I was able to run the ./nagflux, the data was transmitted to InfluxDB (hosted on Win10 test), and able to pull Graph on Grafana.

However, seems like after running ./nagflux, it only transmitted what was there, not what was coming in more. I monitored for 2-3hrs but no further data since I ran the command was transmitted to InfluxDB.

I am wondering if this needs to be running constantly:

The scripts are necessary to write performance data to pnp4nagios and nagflux.
# vi /usr/local/nagios/libexec/process-host-perfdata-file-bulk
#!/bin/bash

/bin/cp -p /usr/local/nagios/var/host-perfdata /usr/local/nagios/var/spool/nagfluxperfdata/${1}.perfdata.host
/bin/mv /usr/local/nagios/var/host-perfdata /usr/local/nagios/var/spool/xidpe/${1}.perfdata.host


I will look into Cacti if this will not work.

Re: NagFlux on Nagio/with Nagios

Posted: Thu Dec 14, 2017 3:14 pm
by vnuna
Disregard my previous comment on the bash command, I was able to enter that in /vi and able to save, after starting ./nagflux, I see the data is coming in to InfluxDB. But on Nagios machine I am seeing this:

2017-12-14 15:09:59 Warn: Influx status: 400 Bad Request - {"error":"unable to parse 'metrics,host="actual hostname",service=,command=check_xi_host_ping,performanceLabel=pl,crit-fill=none,warn-fill=none,unit=% crit=100.0,value=0.0,warn=80.0 1513282187000': missing tag value\nunable to parse 'metrics,host="actual host name",service=,command=check_xi_host_ping,performanceLabel=rtmax,unit=ms value=15.375 1513282187000': missing tag value"}

2017-12-14 15:09:59 Critical: open /usr/local/nagios/var/log/nagflux/nagflux.dump-nagflux.influx-errors: no such file or directory
2017-12-14 15:10:29 Critical: Connection type is unknown, options are: tcp, file. Input:

the above two should go away after I create that directory. Will report back. But what about the first one, it says at the end "missing tag value"

Re: NagFlux on Nagio/with Nagios

Posted: Thu Dec 14, 2017 3:54 pm
by dwhitfield
What versions of InfluxDB, nagflux, and Grafana are you running? I don't know much about these, but it looks like there are some related bug reports. The version of influxdb in the instructions is very old. I likes 0.13.0, but they are now on 1.4.2. Also, what OS version are you on? I see some influx-related items in the CentOS 6 epel repo, though I think it may be even older.

Re: NagFlux on Nagio/with Nagios

Posted: Fri Dec 15, 2017 6:59 pm
by vnuna
These are the versions:
1. InfluxDB 1.4.2 Window
2. Nagflux0.9+
3. Grafana 4.6.2 Windows
4. Chronograf 1.3.10.0 Windows (Optional)

NagiosXI and Nagflux are on same OS - Linux (same machine)
InfluxDB, Grafana, and Chronograf - Windows (same machine)

Re: NagFlux on Nagio/with Nagios

Posted: Mon Dec 18, 2017 4:29 pm
by kyang
Which OS and version are you on for XI?

In your previous post, you mentioned that if you created the dir for two of the errors it would go away?
Was that the case, and if so did they go away?

Any updates on the missing tag value\nunable to parse error?

Any illegal characters that may result in the 400 bad request?