Hello

Here is my manifest for snmpd, my problem now is that my manifest will run 
every time because my snmpd.conf file changes after the "exec"!! I want 
that my manifest run when the snmpd.conf (only snmpd.conf source and not 
with exec) file change or when my /etc/fstab file on the client change and 
it restart the snmpd service.


I do not know if I'm very clear, but it is not easy to explain it in English
.

Did you have an idea?

class snmpd::redhat {
    package { "net-snmp":
            ensure => present,
    }

file { "/etc/snmp/snmpd.conf":
            ensure => present,
            owner  => 'root',
            group  => 'root',
            mode => 644,
            source => "puppet:///modules/snmpd/snmpd.conf",
            require=> Package["net-snmp"],
            notify  => Exec["disk-snmp"]
        #    notify  => Service["snmpd"]
    }


file { "/etc/fstab":
            ensure => present
    }


exec { "disk-snmp":
        command   => "grep -e \"ext[2-4]\" /etc/fstab|awk '{print 
\"disk\",'$\2'}' >> /etc/snmp/snmpd.conf",
#       subscribe => File["/etc/snmp/snmpd.conf"],
        subscribe => File["/etc/fstab"],
        path => ["/usr/bin", "/bin", "/usr/sbin"],
        notify  => Service["snmpd"]
    }


service { "snmpd":
             ensure     => running,
             hasstatus  => true,
             hasrestart => true,
             enable     => true,
             require    => File['/etc/snmp/snmpd.conf']
        }
}


my source : snmpd.conf :

com2sec nagios          192.168.1.1   communaute
view tout included .1
group collecte v1 cacti
access collecte "" any noauth exact tout none none
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820stat



Is it possible in my snmpd.conf source a solution as :

com2sec nagios          192.168.1.1   communaute
view tout included .1
group collecte v1 cacti
access collecte "" any noauth exact tout none none
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820stat
*Exec **["disk-snmp"]*

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to