Hello Nan,

The reason of checking the directory is because sometime we have server with
special installation
and hence do not have the nagios-plugins packages installed.. but still it
does not work..

Well let me cut and past the whole file:

class fly-nagios::client inherits fly-nagios::base {

        include nagios::base

        case $operatingsystem {
                "centos" : { $nagios_plugins_dir =
"/usr/lib64/nagios/plugins" }
                "redhat" : { $nagios_plugins_dir =
"/usr/lib64/nagios/plugins" }
                "debian" : { $nagios_plugins_dir = "/usr/lib/nagios/plugins"
}
                "ubuntu" : { $nagios_plugins_dir = "/usr/lib/nagios/plugins"
}
        }

        file { "$nagios_plugins_dir" :
                name => "$nagios_plugins_dir",
                mode => 0755, owner => bin, group => bin,
                ensure => directory,
        }

        define nagiosPlugins () {
                file { "$name" :
                        path => "$nagios_plugins_dir/$name",
                        source =>
"puppet:///fly-nagios/etc/nagios/bin-fly/$name",
                        mode => 0555, owner => bin, group => bin,
                        replace => true,
                        ensure => file,
                }
        }


        nagiosPlugins { [
                "check_disk.pl",
                "check_fly_kestrel",
                "check_fly_mongo",
                "check_fly_mongo_repl",
                "check_memcached.py",
                "check_mmm_agent",
                "check_mmm_mon",
                "check_mmm_mon_cluster",
                "check_outgoing_traffic",
                "check_ram" ]:
        }

}

==== error:


err: Could not retrieve catalog from remote server: Error 400 on SERVER:
Duplicate definition: Fly-nagios::Client::Nagiosplugins[check_fly_kestrel]
is already defined in file
/var/lib/puppet/fly/modules/fly-nagios/manifests/client.pp at line 40;
cannot redefine at
/var/lib/puppet/fly/modules/fly-nagios/manifests/client.pp:40 on node puppet


thanks for any pointer/help












On Mon, Sep 13, 2010 at 6:47 PM, Nan Liu <[email protected]> wrote:

> On Mon, Sep 13, 2010 at 5:41 PM, Luc Suryo <[email protected]> wrote:
>
>> I been Google-ing and read docs for couple hours and can not see what
>> I do wrong... can someone help?
>>
>
> Yes, except the code you copied and pasted doesn't match the error message
> since  it should of thrown a cannot find class error among several other
> issues, so I'm not sure how it even got to the error message in your email.
>
> class our-nagiios::client {
>
>
>  class our-nagios::client
>
>        define my_nagios_plugins ( $name ) {
>>
>
> You don't need to pass $name as a variable, $name = the title/namevar of
> the resource, and $name is only in scope between { }.  Puppet should throw
> an exception here as well. It should simply be:
>
> define my_nagios_plugins() {
>
>
>>                file { "$name" :
>>                        name => "$nagios_plugins_dir/$name",
>>
>
> did you mean path => "${nagios_plugins_dir}/${name}" instead of name => ...
> ?
>
>
>>                        source => "puppet:///nagios/etc/nagios/bin/
>> $name",
>>                        mode => 0555, owner => bin, group => bin,
>>                        replace => true,
>>                        ensure => file,
>>                        after => File [ "$nagios_plugins_dir" ],
>>
>
> Do you mean require => File["$nagios_plugins_dir"] ? File dependency is
> implicit, so puppet knows to require a parent directory before the file, so
> it's not necessary.
>
> Thanks,
>
> Nan
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<puppet-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>



-- 
-ls

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to