Hi Brian,

I have the same problem generating action_url content dynamically from hostname, service_description and Custom variables. While variables in URL fields are correctly interpreted in Icinga classic ui, they aren't on their way to icinga Web. There is a new feature adressing this, hopefully released soon.

Kind regards,

Marco Hoyer

 
Gesendet: Mittwoch, 05. Februar 2014 um 21:31 Uhr
Von: "Jannis Moßhammer" <[email protected]>
An: "Icinga User's Corner" <[email protected]>
Betreff: Re: [icinga-users] Using a customvar within icinga-web cronks XML
Hey,

The problem is that CVs are stored as host_cvname and host_cnvalue - and i don’t even think you can access them like this (as the db layout doesn’t make it very easy to fetch customvars on the fly). So without modifying the code It’s not possible to do it your way (which definitely makes sense), sorry.

Regards

On Feb 5, 2014, at 18:20 , Brian O'Neill <[email protected]> wrote:

> Bumping in case this got missed on the weekend. Appreciate any pointers to what I need to do where...
>
>
> On 1/31/2014 10:31 AM, Brian O'Neill wrote:
>> I'm setting up multiple icinga servers in various locations with
>> PNP4Nagios at each location, and setting up Icinga Web as a "single pane
>> of glass" at a central location. I've got the IDO stuff working fine.
>>
>> I'm trying to figure out the best way to integrate the PNP graphs from
>> the different locations with Icinga Web - I've tried a few different
>> ways, but none have worked so far. Mostly I'm running into macros that
>> don't expand in the action URL (like $USERx$), and it doesn't seem like
>> macro substitutions are done before the URL is sent to icinga-web anyways.
>>
>> So I'm looking at the existing PNP integration cronk, where the graph
>> URL is harcoded to a local PNP4Nagios installation. I see it does it's
>> own macro expansion:
>>
>> <parameter
>> name="src"><![CDATA[/pnp4nagios/image?host={host_name}&srv={service_name}&view=0]]></parameter>
>>
>>
>> So ideally, I could include another macro in there based off the
>> collector name, or at a minimum a customvar. I tried to define a
>> customvar like "_MONFQDN" in the host, and I can see that it appears in
>> Customvars in Icinga Web as MONFQDN, but I'm a bit at a loss for being
>> able to use it.
>>
>> I tried creating this in the <fields> section:
>>
>> <field name="host_monfqdn">
>> <datasource>
>> <parameter name="field">HOST_MONFQDN</parameter>
>> </datasource>
>> <display>
>> <parameter name="visible">true</parameter>
>> <parameter name="label">Monitoring
>> host</parameter>
>> <parameter name="width">150</parameter>
>> </display>
>> <filter>
>> <parameter name="enabled">false</parameter>
>> </filter>
>>
>> <order>
>> <parameter name="enabled">false</parameter>
>> <parameter name="default">false</parameter>
>> </order>
>> </field>
>>
>> And changing the URL to:
>>
>> <parameter
>> name="url"><![CDATA[http://{host_monfqdn}/pnp4nagios/index.php/graph?host={host_name}&srv={service_name}]]></parameter>
>>
>>
>> But not only doesn't it get used, but it drops a slash:
>>
>> http://pnp4nagios/index.php/graph?host=testhost&srv=CPU
>>
>> I could be missing something, or it might not be possible and I have to
>> rethink how to do it altogether (rsync RRD files to the central server?)
>>
>> Thanks for any insight...
>>
>> -Brian
>> _______________________________________________
>> icinga-users mailing list
>> [email protected]
>> https://lists.icinga.org/mailman/listinfo/icinga-users
> _______________________________________________
> icinga-users mailing list
> [email protected]
> https://lists.icinga.org/mailman/listinfo/icinga-users

_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users
_______________________________________________
icinga-users mailing list
[email protected]
https://lists.icinga.org/mailman/listinfo/icinga-users

Reply via email to