Ask Your Question
0

I'm trying to use the $title value of a resource in a nagios_service definition

asked 2015-01-29 06:01:02 -0500

RandalGarcia gravatar image

updated 2015-01-29 10:49:22 -0500

Hi, can someone help please? I'm trying to use the $title value of a resource in a nagiosservice definition (basically the value that gets used in _naginatorname) but it's always the $title of the class, not the resource that is showing up in the resulting nagios_service definition

How do I get to the resource $title?

Update: I have tried the same with $name too and get exactly the same result.

e.g.: class nagios::hostgroup::linux { nagiosservice { 'checkssh' : hostgroupname => 'linux-servers', servicedescription => 'SSH server Listening', checkcommand => 'checkssh', use => 'generic-service', target => '/etc/nagios/puppet/service.cfg', require => File['/etc/nagios/puppet'], display_name => $title } }

produces: define service { use generic-service hostgroupname linux-servers checkcommand checkssh displayname nagios::hostgroup::linux servicedescription SSH server Listening ## --PUPPETNAME-- (called 'naginatorname' in the manifest) check_ssh }

but I want the display name to be 'check_ssh'

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-01-29 10:27:54 -0500

lavaman gravatar image

Resources don't have titles, they have names. Try $name instead.

edit flag offensive delete link more

Comments

Thanks, I should have added (and will update to the post to do so); I've tired both $title and $name and get the same result.

RandalGarcia gravatar imageRandalGarcia ( 2015-01-29 10:48:30 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2015-01-29 06:01:02 -0500

Seen: 151 times

Last updated: Jan 29 '15