custom variable definition

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
pennylane
Posts: 6
Joined: Thu Jul 21, 2011 3:31 am

custom variable definition

Post by pennylane »

Hello all,

I want to define a custom variable in contactgroups.cfg file like below:

define contactgroup{
contactgroup_name admins
_CG_ID 1
alias administrators
members linuxad, windowsad
}

When I verify the config file it gives me an error:
"Error: Invalid contactgroup object directive '_CG_ID'."

I am using the Nagwin version of Nagios which is for Windows. I tried the same in Nagios on Ubuntu and it is not complaining. Do you have any suggestions?

Thanks a lot.
crfriend
Posts: 61
Joined: Thu Sep 01, 2011 7:53 am
Location: Central New England (USA)
Contact:

Re: custom variable definition

Post by crfriend »

pennylane wrote:"Error: Invalid contactgroup object directive '_CG_ID'."
The documentation strongly hints that custom variables only work with hosts, services, and contacts (not contactgroups). I've not tried setting custom variables on anything other than hosts and services at the moment, but the hints do carry some weight.

I find it odd that Nagwin is silent on the matter. Does the the custom variable actually work in that environment, or is the syntax-checker merely silent?
pennylane
Posts: 6
Joined: Thu Jul 21, 2011 3:31 am

Re: custom variable definition

Post by pennylane »

Thanks a lot for your reply. I just realised that I created a contact definition in Ubuntu instead of a contactgroup defn. And yes for contact it is working but not for contact group. Thanks again
Locked