Re:Ask HN: What tools do you use to monitor your LAMP server...
by taa on Saturday October 23, 2010 @11:58PM
(#1825159)
Can you share the relevant snippets from your puppet setup? I'm currently looking at using puppet with nagios/monit to manage the 50+ servers that recently became my responsibility.
Re:Ask HN: What tools do you use to monitor your LAMP server...
by mrud on Sunday October 24, 2010 @03:13AM
(#1825506)
If you start with puppet you should definitely have a look at the type documentation http://docs.puppetlabs.com/references/stable/type.html It helps a lot to see and understand the already integrated types for puppet.
For monit i am using the monit pattern from[1]. Quite simple but IWFM. Nagios is a little bit more complicated. If you have any questions i added my mailaddresse to my profile.
You need to use exported resources for the nagios part. Therefore you have to enable Stored Configurations on the puppet server [2]. For the server part i use:
package { nagios3: ensure => present }
service{nagios3:
ensure => running,
enable => true,
require => Package[nagios3],
}
exec { "chmod_nagios":
command => "/bin/chmod 644 /etc/nagios3/conf.d/*",
refreshonly => true,
notify => Service["nagios3"]
}
file { "/etc/nagios3/conf.d": ensure => directory }
Nagios_host <<||>> { notify => Exec["chmod_nagios"] }
Nagios_service <<||>> { notify => Exec["chmod_nagios"] }
The client setup is quite easy, im using nagios-nrpe for the check. You have to deploy your own configuration files, i omit them here. package { nagios-nrpe-server: ensure => installed }
service { nagios-nrpe-server:
ensure => running,
require => Package[nagios-nrpe-server],
pattern => "/usr/sbin/nrpe"
}
@@nagios_host { "host_$hostname":
ensure => present,
address => $ipaddress,
host_name => $hostname,
use => "generic-host",
target => "/etc/nagios3/conf.d/host-$hostname.cfg",
}
@@nagios_service { "apt-${hostname}":
ensure => present,
use => "generic-service",
host_name => $hostname,
service_description => "apt check",
target => "/etc/nagios3/conf.d/apt.cfg",
check_command => "check_nrpe_1arg!check_apt"
}
[1] http://projects.puppetlabs.com/projects/1/wiki/Monit_Pattern...[2] http://projects.puppetlabs.com/projects/puppet/wiki/Using_St... You should not use sqlite, use mysql if you want to use the dashboard
[puppetmasterd]
storeconfigs = true
dbadapter = sqlite3
dblocation = /var/lib/puppet/storeconfigs.sqlite
I am also using monit for immediate actions like restarting web server or checking some programs.
I manage both via puppet, that means I deploy a new host and the nagios configuration gets adjusted automatically with the corresponding services.
For performance data there are several tools like cacti, munin or collectd.
- Munin has iirc the problem thats it gets slowish as it polls all data from hosts then generate the carts for all hosts. Only a problem if you have many hosts...
- Collectd is a quite nice and fast monitoring solution (supports updates every second) and has advanced features like sending the data to multicast addresses. The only imho major drawback is that there comes no good webui bundled with collectd though many external uis exists.
EDIT: I forgot to mention icigna http://www.icinga.org/ a fork of nagios after some trademark problems iirc.
Monit and nagios are integrated with the ticketing system, e.g. recovery message closes automatically the corresponding ticket.