forked from jashmenn/poolparty-mrtg-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmonitorings.rb
87 lines (66 loc) · 2.11 KB
/
monitorings.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
module PoolParty
module Mrtg
module Monitorings
def enable_cpu
has_package("sysstat")
has_cron(:name => "Run sysstat sa1",
:command => "/usr/lib/sysstat/sa1 -d 1 1",
:minute => "*/10")
has_cron(:name => "Run sysstat sa2",
:command => "/usr/lib/sysstat/sa2 -A",
:hour => "23",
:minute => "53")
end
def enable_apache
mod_status =<<EOF
<IfModule mod_status.c>
#
# Allow server status reports generated by mod_status,
# with the URL of http://servername/server-status
# Uncomment and change the ".example.com" to allow
# access from other hosts.
#
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from localhost ip6-localhost
Allow from 127.0.0.1
Satisfy Any
</Location>
</IfModule>
EOF
has_file({:content => mod_status,
:name => "/etc/apache2/mods-available/status.conf",
:ensures => 'present',
:requires => get_package("apache2")})
# present_apache_module("custom_status", :requires => get_file("/etc/apache2/mods-available/custom_status.conf"))
# has_symlink({:name => "/etc/apache2/mods-enabled/custom_status.conf",
# :source => "/etc/apache2/mods-available/custom_status.conf",
# :requires => get_file("/etc/apache2/mods-available/custom_status.conf") })
has_package("lynx") # todo, remove this dependency
end
# The enable statements below are not required to add something to the
# mrtg config. However, they can be used if you want to enable specific
# dependencies for a particular monitoring.
def enable_uptime
end
def enable_disk
end
def enable_memory
end
def enable_processes
end
def enable_uptime
end
def enable_snmp_free_memory
end
def enable_open_files
end
def enable_snmp_network
end
def enable_network_interfaces
end
end
end
end