Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add InfluxDB support #37

Open
bunghi opened this issue Jul 12, 2018 · 17 comments
Open

Add InfluxDB support #37

bunghi opened this issue Jul 12, 2018 · 17 comments
Assignees

Comments

@bunghi
Copy link

bunghi commented Jul 12, 2018

Hi,

We are using Icinga2 with InfluxDB as data store engine. Is there any way to use the plugin with InfluxDB?

Thanks

@Tontonitch
Copy link
Owner

Hello,

You should be able to use the plugin with InfluxDB.
In fact, you just have to configure (through plugin parameters) the plugin to write performance data with the plugin output. This is the default. Icinga's InfluxDBWriter should then feed your InfluxDB database.

There is a second way of handling performance data: using the --perfdatadir option will create spool perfdata files which can be processed by a graphing solution such as pnp or nagiosgrapher. This second method is nice as the performance data are not processed by icinga2, are not limited by icinga2 variable lengths, and are not shown in icingaweb2 (for big switches it generates a lot of performance data).
Unfortunately, I didn't have the opportunity to write the equivalent for influxdb / graphite.

BR,
Yannick

@bunghi
Copy link
Author

bunghi commented Jul 12, 2018

Hi,

Checking the script parameters i found this:

    #------- performance data -------#
    'enableperfdata'            => 0,
    'portperfunit'              => "bps",
    'perfdataformat',           => "full",
    'perfdatathreshold',        => "full",
    'perfdatadir',              => undef,
    'perfdataservicedesc',      => undef,
    'grapher'                   => "influxdb",
    'grapherurl'                => "/pnp",

If I set grapher to influxdb instead of pnp4nagios what should I set for grapheurl?

@Tontonitch
Copy link
Owner

Sorry, I missed your comment.

InfluxDB is not available as a supported graphing solution. You can use the default (pnp4nagios) settings, and redefine the generated url, but it would be easier to add the influxdb option in fact.

To do that, could you tell me what would be the url to generate in order to access the graph of the service?

@bunghi
Copy link
Author

bunghi commented Oct 10, 2018

Hi, sorry for the delay.

Well, I am using Icingaweb2 with Grafana module and the current URL to see the graphs is this one (using the icinga2-default template):

Example:

http://<grafana_server>/icinga2-default?var-hostname=&var-service=<service_name>&var-command=<service_command>

Maybe the problem is not only the grapher but also the script output details link:
image

I managed to modify the script so the link works (icinga web server and icinga worker are different systems):

image

The problem I have is that css style is not working..

@Tontonitch
Copy link
Owner

if you use the dev tools of chrome and the network part and reload the page, what's the expected location of the css file?

i.e.:
image

@bunghi
Copy link
Author

bunghi commented Oct 10, 2018

Wow! Thanks for the super fast answer!! Indeed, dev tools helped me a lot. The thing is the files were there but some aliases were missing from apache. Now I can see the page with css loaded but i have no action button/link to see the graph:

image

@Tontonitch
Copy link
Owner

Tontonitch commented Oct 10, 2018

If I remember well "Actions" objects are dependent to some script options.
The action "go to the corresponding graph" which also generates a popup with the graph depend on the "grapher" option. Influxdb/grafana is not supported currently, so I guess the action is not proposed. I should check that when I will have some free time.

@bunghi
Copy link
Author

bunghi commented Oct 11, 2018

Hi again,
I found the way to enable the actions objects and now i'm trying to figure out how to get the hostname variable to build the url for Grafana. This is what I have for the URL by now:

'href="' . $ghOptions{'grapherurl'} . '/icinga2-new?var-hostname=' . $ghOptions{'hostdisplay'} . '&var-metric=' . $servicename . '" ' .

The thing is that 'hostdisplay' is showing the ip instead of the hostname. I tried with host/hostquery/hostname but it doesn't work.

What's the variable for the node name?

image

@bunghi
Copy link
Author

bunghi commented Oct 11, 2018

Nevermind, I was using the IP for the script -H argument. Changed it to hostname and it works.

Now I just have to build the right Grafana URL, but that's out of this topic scope.

Thanks for your help and I hope soon there will be influxdb writer compatibility.

@mdicss
Copy link

mdicss commented Oct 11, 2018

Hi bungi
Could you please share the details how to integrate interfacetable_v3t with icinga2, icingaweb2, influxdb and grafana?
For now, I installed interfacetable_v3t with the default pnp4nagios grapher solution. I can call the skript on the commandline and view the generated webpage but JQuery and the pnp4nagions JavaScript scripts are missing for the hostname dropdown.
How can I correct this?
In the end, I have to integrate the skript output with icinga2, icingaweb2, influxdb and grafana.
It would be very helpful for me, to have the details of your solution for this integration.

Many thanks in advance and kind regards
Matthias

@Tontonitch
Copy link
Owner

Tontonitch commented Oct 11, 2018

Nevermind, I was using the IP for the script -H argument. Changed it to hostname and it works.

For your info, you can use the IP for the -H parameter. In such a case you can specify the hostdisplay parameter through the -h option

@bunghi
Copy link
Author

bunghi commented Oct 12, 2018

Hi @mdicss

I couldn't fix the node dropdown neither. I'm still working on the Grafana URL, the thing is that I don't know how to parse the metric field to icinga2-default dashboard.

The thing is that for each port there are 6 metrics. Example, for port FC port 0/0:

image

image

Now, when I click on the Actions icon of port FC port 0/0 I should be redirected to Grafana and show all the graphs where the metrics starts with If_FC_port_0/0* and I don't know how to do that..

@mdicss
Copy link

mdicss commented Oct 12, 2018

Hi
I use -H and -h for IP-adress and name of the host.
I installed pnp4nagios, so I have the JQery stuff. I need to configure apache access rights correctly there.
With this, I had the problem, that I did not see the hosts in the dropdown, when I opened the Webpage. After clicking on 'go', the names are there. To fix this, I changed the first lines in index.php like this:

<script> $(document).ready(function(){ $("#nodeselect").submit(); }); </script> -- select a node -- So you see the corrct list after the page is initially loaded. Maybe this can be integrated in interfacetable_vt3. Regards Matthias

@mdicss
Copy link

mdicss commented Oct 12, 2018

Hi
Sorry, I have some problems using this website and using markdown. Maybe the reason is, that I have to use IE.
So, you have to insert some linebreaks in the html-part in my comment above.

@mdicss
Copy link

mdicss commented Oct 12, 2018

is missing above too. So you can reference the form and use $("#nodeselect").submit()

@Tontonitch
Copy link
Owner

Hi
I use -H and -h for IP-adress and name of the host.
I installed pnp4nagios, so I have the JQery stuff. I need to configure apache access rights correctly there.
With this, I had the problem, that I did not see the hosts in the dropdown, when I opened the Webpage. After clicking on 'go', the names are there. To fix this, I changed the first lines in index.php like this:

<script> $(document).ready(function(){ $("#nodeselect").submit(); }); </script> -- select a node -- So you see the corrct list after the page is initially loaded. Maybe this can be integrated in interfacetable_vt3. Regards Matthias

You can edit the index.php file and create a Pull Request through github directly. If valid I will merge it.

@Tontonitch Tontonitch changed the title Does it work with InfluxDB? Add InfluxDB support Dec 5, 2018
@Tontonitch Tontonitch added this to the v1.01 milestone Dec 5, 2018
@Tontonitch Tontonitch modified the milestones: v1.01, v1.00 Jan 4, 2019
@Tontonitch Tontonitch self-assigned this Jan 4, 2019
@Tontonitch Tontonitch modified the milestones: v1.00, v1.01 Jan 4, 2019
@sgruber94
Copy link

Is there already an implemented version of the Influx Integration?

@Tontonitch Tontonitch removed this from the v1.01 milestone Sep 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants