Is there a line length limitation for custom object vars?

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
skol
Posts: 29
Joined: Mon Jan 28, 2013 3:56 pm

Is there a line length limitation for custom object vars?

Post by skol »

Hey guys, is there a line length limitation for custom macros in nagios XI and nagios core? i.e:

Code: Select all

define service {
        use                             template
        host_name                       hostname
        _interface_description          intdesc
        register                        1
}
For example if _interface_description was a combination of 100 keyword=value pairs.

Thanks!
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Is there a line length limitation for custom object vars

Post by abrist »

Are there any end of lines in 'intdesc' or exclamation points?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
skol
Posts: 29
Joined: Mon Jan 28, 2013 3:56 pm

Re: Is there a line length limitation for custom object vars

Post by skol »

No, it would look like this (except much, much longer). My previous example was not very good.

Code: Select all

define service {
        use                             template
        host_name                       hostname
        _service_fields                 -m oid=.1.3.6.1... -a 10.1.1.1 -c mycommunity something=yes description=some_desc hostname=myhostname field=value field=value field=value field=value field=value field=value field=value field=value field=value field=value field=value field=value 
        register                        1
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Is there a line length limitation for custom object vars

Post by abrist »

I can ask one of our core devs tomorrow. Have you noticed truncation, or does it just fail?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
skol
Posts: 29
Joined: Mon Jan 28, 2013 3:56 pm

Re: Is there a line length limitation for custom object vars

Post by skol »

abrist wrote:I can ask one of our core devs tomorrow. Have you noticed truncation, or does it just fail?
I just wanted to make sure what I'm trying to do won't hit a limitation.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Is there a line length limitation for custom object vars

Post by sreinhardt »

There does not appear to be a size restriction on this. If you can I would suggest sticking under the 1024 limit that is applied to most strings within nagios, but that doesn't really seem to be enforced in this case. (Note: not a dev, but did dig through the code, most importantly ./includes/objects.h that contains the customvariablemember scruct and the service struct.)
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
skol
Posts: 29
Joined: Mon Jan 28, 2013 3:56 pm

Re: Is there a line length limitation for custom object vars

Post by skol »

Thanks a bunch, I appreciate it!
Locked