Using Variables in Service ARGS and Hosts

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
gpi
Posts: 23
Joined: Thu Dec 11, 2014 4:03 am

Using Variables in Service ARGS and Hosts

Post by gpi »

Hello,

I am setting up a bunch of servers whose filesystem's will need to be monitored, but I do not want to create a single Service for each one. I though of creating Variables on Nagios Service and Host side:

Image

So I could attach the Service to all Host and set up individually the threshold for the filesystem on Host variable's side, which i guess his value would overried Service one, isn't it?

Did anyone could manage to configure a service using as arguments those variables? Is that possible, or maybe I am trying something not implemented? Also, is there any "better" way to do this?

Image

The goal is something like this:

COMMAND: /usr/local/nagios/libexec/check_disk -w $_FsWarn -c $_FsCrit -p $_Instance/$OracleHome/

Thanks in advance and best regards,

J.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Using Variables in Service ARGS and Hosts

Post by jdalrymple »

Custom object macros work perfectly... just gotta get your syntax nailed down:

https://assets.nagios.com/downloads/nag ... tvars.html

For host custom macros:

$_HOSTMYCUSTOMMACRO$

For service macros:

$_SERVICEMYCUSTOMMACRO$

etc.
Locked