le1t0-deprec 2.1.6.001

Sign up to get free protection for your applications and to get access to all the features.
Files changed (230) hide show
  1. data/CHANGELOG +444 -0
  2. data/COPYING +19 -0
  3. data/LICENSE +339 -0
  4. data/README +154 -0
  5. data/THANKS +17 -0
  6. data/bin/depify +139 -0
  7. data/docs/EXAMPLE-installing_tracks.txt +41 -0
  8. data/docs/README.nagios +22 -0
  9. data/docs/README.rails +17 -0
  10. data/docs/config_gen_explained.txt +39 -0
  11. data/docs/deprec-1.x/deprec-1.x.quickstart +50 -0
  12. data/docs/deprec-1.x/notes.txt +12 -0
  13. data/docs/old/deprec_banner.gif +0 -0
  14. data/docs/windows_linux.txt +350 -0
  15. data/docs/xen/traffic_monitoring_with_vnstat.txt +95 -0
  16. data/docs/xen/xen-tools-notes.txt +31 -0
  17. data/docs/xen/xen_on_hardy.txt +39 -0
  18. data/lib/deprec.rb +42 -0
  19. data/lib/deprec/capistrano_extensions.rb +446 -0
  20. data/lib/deprec/recipes.rb +7 -0
  21. data/lib/deprec/recipes/aoe.rb +79 -0
  22. data/lib/deprec/recipes/app/mongrel.rb +213 -0
  23. data/lib/deprec/recipes/app/passenger.rb +190 -0
  24. data/lib/deprec/recipes/ar_sendmail.rb +67 -0
  25. data/lib/deprec/recipes/aspell.rb +22 -0
  26. data/lib/deprec/recipes/canonical.rb +68 -0
  27. data/lib/deprec/recipes/cap.rb +39 -0
  28. data/lib/deprec/recipes/chef.rb +68 -0
  29. data/lib/deprec/recipes/collectd.rb +112 -0
  30. data/lib/deprec/recipes/db/couchdb.rb +107 -0
  31. data/lib/deprec/recipes/db/mysql.rb +194 -0
  32. data/lib/deprec/recipes/db/postgresql.rb +104 -0
  33. data/lib/deprec/recipes/db/sqlite.rb +37 -0
  34. data/lib/deprec/recipes/ddclient.rb +51 -0
  35. data/lib/deprec/recipes/deprec.rb +167 -0
  36. data/lib/deprec/recipes/deprecated.rb +71 -0
  37. data/lib/deprec/recipes/drbd.rb +137 -0
  38. data/lib/deprec/recipes/dummy.rb +22 -0
  39. data/lib/deprec/recipes/example.rb +115 -0
  40. data/lib/deprec/recipes/git.rb +97 -0
  41. data/lib/deprec/recipes/gitosis.rb.disabled +55 -0
  42. data/lib/deprec/recipes/glusterfs.rb +176 -0
  43. data/lib/deprec/recipes/god.rb +70 -0
  44. data/lib/deprec/recipes/haproxy.rb +115 -0
  45. data/lib/deprec/recipes/heartbeat.rb +138 -0
  46. data/lib/deprec/recipes/imagemagick/imagemagick_bin.rb +24 -0
  47. data/lib/deprec/recipes/imagemagick/imagemagick_src.rb +39 -0
  48. data/lib/deprec/recipes/integrity.rb +108 -0
  49. data/lib/deprec/recipes/iptables.rb +94 -0
  50. data/lib/deprec/recipes/java.rb +23 -0
  51. data/lib/deprec/recipes/keepalived.rb +78 -0
  52. data/lib/deprec/recipes/ldap.rb +52 -0
  53. data/lib/deprec/recipes/logrotate.rb +56 -0
  54. data/lib/deprec/recipes/lvm.rb +20 -0
  55. data/lib/deprec/recipes/memcache.rb +49 -0
  56. data/lib/deprec/recipes/mongodb.rb +94 -0
  57. data/lib/deprec/recipes/monit.rb +135 -0
  58. data/lib/deprec/recipes/mysql_proxy.rb +67 -0
  59. data/lib/deprec/recipes/nagios.rb +361 -0
  60. data/lib/deprec/recipes/network.rb +116 -0
  61. data/lib/deprec/recipes/ntp.rb +103 -0
  62. data/lib/deprec/recipes/php.rb +58 -0
  63. data/lib/deprec/recipes/postfix.rb +115 -0
  64. data/lib/deprec/recipes/profiles.rb +125 -0
  65. data/lib/deprec/recipes/raid/amcc_3ware.rb +21 -0
  66. data/lib/deprec/recipes/rails.rb +330 -0
  67. data/lib/deprec/recipes/redhat_cluster.rb +228 -0
  68. data/lib/deprec/recipes/redis.rb +90 -0
  69. data/lib/deprec/recipes/ruby/mri.rb +55 -0
  70. data/lib/deprec/recipes/ruby/ree.rb +40 -0
  71. data/lib/deprec/recipes/rvm.rb +32 -0
  72. data/lib/deprec/recipes/s3utils.rb +63 -0
  73. data/lib/deprec/recipes/sphinx/thinking_sphinx.rb +105 -0
  74. data/lib/deprec/recipes/sphinx/ultrasphinx.rb +86 -0
  75. data/lib/deprec/recipes/ssh.rb +147 -0
  76. data/lib/deprec/recipes/ssl.rb +56 -0
  77. data/lib/deprec/recipes/starling.rb +119 -0
  78. data/lib/deprec/recipes/svn.rb +171 -0
  79. data/lib/deprec/recipes/syslog.rb +63 -0
  80. data/lib/deprec/recipes/trac.rb.disabled +277 -0
  81. data/lib/deprec/recipes/tsung.rb +74 -0
  82. data/lib/deprec/recipes/ubuntu.rb +90 -0
  83. data/lib/deprec/recipes/users.rb +90 -0
  84. data/lib/deprec/recipes/utils.rb +58 -0
  85. data/lib/deprec/recipes/vnstat.rb +85 -0
  86. data/lib/deprec/recipes/web/apache.rb +143 -0
  87. data/lib/deprec/recipes/web/nginx.rb +172 -0
  88. data/lib/deprec/recipes/wordpress.rb.notworking +96 -0
  89. data/lib/deprec/recipes/wpmu.rb +103 -0
  90. data/lib/deprec/recipes/xen.rb +364 -0
  91. data/lib/deprec/recipes/xentools.rb +101 -0
  92. data/lib/deprec/recipes_minus_rails.rb +125 -0
  93. data/lib/deprec/templates/aoe/aoe-init +55 -0
  94. data/lib/deprec/templates/aoe/fence_aoemask +351 -0
  95. data/lib/deprec/templates/apache/namevirtualhosts.conf +5 -0
  96. data/lib/deprec/templates/apache/ports.conf.erb +5 -0
  97. data/lib/deprec/templates/apache/status.conf.erb +17 -0
  98. data/lib/deprec/templates/ar_sendmail/logrotate.conf.erb +9 -0
  99. data/lib/deprec/templates/ar_sendmail/monit.conf.erb +5 -0
  100. data/lib/deprec/templates/chef/chef.json.erb +1 -0
  101. data/lib/deprec/templates/chef/solo.rb +2 -0
  102. data/lib/deprec/templates/collectd/collectd-init.d +153 -0
  103. data/lib/deprec/templates/collectd/collectd.conf.erb +686 -0
  104. data/lib/deprec/templates/ddclient/ddclient.conf.erb +11 -0
  105. data/lib/deprec/templates/ddclient/ddclient.erb +15 -0
  106. data/lib/deprec/templates/deprec/caprc.erb +14 -0
  107. data/lib/deprec/templates/drbd/drbd.conf.erb +531 -0
  108. data/lib/deprec/templates/glusterfs/glusterfsd-init.erb +95 -0
  109. data/lib/deprec/templates/gnbd_client/cluster.conf.erb +21 -0
  110. data/lib/deprec/templates/gnbd_client/clvm-default.erb +3 -0
  111. data/lib/deprec/templates/gnbd_client/cman-default.erb +6 -0
  112. data/lib/deprec/templates/gnbd_client/gnbdimports.conf.erb +1 -0
  113. data/lib/deprec/templates/gnbd_server/cluster.conf.erb +20 -0
  114. data/lib/deprec/templates/gnbd_server/clvm-default.erb +3 -0
  115. data/lib/deprec/templates/gnbd_server/cman-default.erb +6 -0
  116. data/lib/deprec/templates/gnbd_server/gnbd-server-default.erb +1 -0
  117. data/lib/deprec/templates/gnbd_server/gnbdexports.conf.erb +1 -0
  118. data/lib/deprec/templates/god/god-conf.erb +2 -0
  119. data/lib/deprec/templates/god/god-init.erb +47 -0
  120. data/lib/deprec/templates/haproxy/haproxy-init.d +120 -0
  121. data/lib/deprec/templates/haproxy/haproxy.cfg.erb +31 -0
  122. data/lib/deprec/templates/heartbeat/authkeys.erb +2 -0
  123. data/lib/deprec/templates/heartbeat/ha.cf.erb +15 -0
  124. data/lib/deprec/templates/heartbeat/haresources.erb +1 -0
  125. data/lib/deprec/templates/integrity/apache_vhost.erb +4 -0
  126. data/lib/deprec/templates/integrity/config.ru.erb +21 -0
  127. data/lib/deprec/templates/integrity/config.yml.erb +43 -0
  128. data/lib/deprec/templates/iptables/firewall-default.erb +13 -0
  129. data/lib/deprec/templates/iptables/firewall-init.erb +171 -0
  130. data/lib/deprec/templates/keepalived/keepalived.conf.erb +18 -0
  131. data/lib/deprec/templates/logrotate/logrotate.conf.erb +32 -0
  132. data/lib/deprec/templates/mongodb/mongodb-init.d +88 -0
  133. data/lib/deprec/templates/mongrel/apache_vhost.conf.erb +148 -0
  134. data/lib/deprec/templates/mongrel/logrotate.conf.erb +11 -0
  135. data/lib/deprec/templates/mongrel/mongrel_cluster-init-script +54 -0
  136. data/lib/deprec/templates/mongrel/mongrel_cluster.yml.erb +10 -0
  137. data/lib/deprec/templates/mongrel/monit.conf.erb +17 -0
  138. data/lib/deprec/templates/mongrel/nginx_vhost.conf.erb +41 -0
  139. data/lib/deprec/templates/monit/monit-init-script +104 -0
  140. data/lib/deprec/templates/monit/monitrc.erb +250 -0
  141. data/lib/deprec/templates/monit/nothing.monitrc +0 -0
  142. data/lib/deprec/templates/mysql/create_databases.sql +20 -0
  143. data/lib/deprec/templates/mysql/database.yml.prod +6 -0
  144. data/lib/deprec/templates/mysql/database.yml.stage +6 -0
  145. data/lib/deprec/templates/mysql/my.cnf.erb +140 -0
  146. data/lib/deprec/templates/mysql/sphinx.conf.prod +542 -0
  147. data/lib/deprec/templates/mysql/sphinx.conf.stage +542 -0
  148. data/lib/deprec/templates/mysql_proxy/mysql-proxy-default.erb +4 -0
  149. data/lib/deprec/templates/nagios/README +32 -0
  150. data/lib/deprec/templates/nagios/cgi.cfg.erb +357 -0
  151. data/lib/deprec/templates/nagios/check_linux_free_memory.pl +118 -0
  152. data/lib/deprec/templates/nagios/check_mongrel_cluster.rb +82 -0
  153. data/lib/deprec/templates/nagios/htpasswd.users +1 -0
  154. data/lib/deprec/templates/nagios/mrtg.cfg +180 -0
  155. data/lib/deprec/templates/nagios/nagios.cfg.erb +1325 -0
  156. data/lib/deprec/templates/nagios/nrpe.cfg.erb +222 -0
  157. data/lib/deprec/templates/nagios/nrpe.xinetd.erb +16 -0
  158. data/lib/deprec/templates/nagios/objects/commands.cfg.erb +265 -0
  159. data/lib/deprec/templates/nagios/objects/contacts.cfg.erb +89 -0
  160. data/lib/deprec/templates/nagios/objects/hosts.cfg.erb +114 -0
  161. data/lib/deprec/templates/nagios/objects/localhost.cfg.erb +116 -0
  162. data/lib/deprec/templates/nagios/objects/services.cfg.erb +165 -0
  163. data/lib/deprec/templates/nagios/objects/timeperiods.cfg.erb +94 -0
  164. data/lib/deprec/templates/nagios/resource.cfg.erb +34 -0
  165. data/lib/deprec/templates/network/hostname.erb +1 -0
  166. data/lib/deprec/templates/network/hosts.erb +2 -0
  167. data/lib/deprec/templates/network/interfaces.erb +18 -0
  168. data/lib/deprec/templates/network/resolv.conf.erb +6 -0
  169. data/lib/deprec/templates/nginx/logrotate.conf.erb +13 -0
  170. data/lib/deprec/templates/nginx/mime.types.erb +70 -0
  171. data/lib/deprec/templates/nginx/nginx-init-script +62 -0
  172. data/lib/deprec/templates/nginx/nginx.conf.erb +125 -0
  173. data/lib/deprec/templates/nginx/nginx.logrotate.d +12 -0
  174. data/lib/deprec/templates/nginx/nothing.conf +1 -0
  175. data/lib/deprec/templates/nginx/rails_nginx_vhost.conf.erb +41 -0
  176. data/lib/deprec/templates/ntp/ntp.conf.erb +42 -0
  177. data/lib/deprec/templates/passenger/apache_vhost.erb +29 -0
  178. data/lib/deprec/templates/passenger/logrotate.conf.erb +12 -0
  179. data/lib/deprec/templates/passenger/passenger.conf.erb +21 -0
  180. data/lib/deprec/templates/passenger/passenger.load.erb +3 -0
  181. data/lib/deprec/templates/postfix/aliases.erb +3 -0
  182. data/lib/deprec/templates/postfix/dynamicmaps.cf.erb +8 -0
  183. data/lib/deprec/templates/postfix/main.cf.erb +36 -0
  184. data/lib/deprec/templates/postfix/master.cf.erb +77 -0
  185. data/lib/deprec/templates/redis/redis-conf.erb +132 -0
  186. data/lib/deprec/templates/redis/redis-init.erb +50 -0
  187. data/lib/deprec/templates/s3utils/s3cfg +35 -0
  188. data/lib/deprec/templates/s3utils/s3config.yml +3 -0
  189. data/lib/deprec/templates/sphinx/monit.conf.erb +5 -0
  190. data/lib/deprec/templates/ssh/ssh_config.erb +50 -0
  191. data/lib/deprec/templates/ssh/sshd_config.erb +78 -0
  192. data/lib/deprec/templates/ssl/make-ssl-cert +138 -0
  193. data/lib/deprec/templates/ssl/ssl-cert-snakeoil.key +15 -0
  194. data/lib/deprec/templates/ssl/ssl-cert-snakeoil.pem +19 -0
  195. data/lib/deprec/templates/starling/monit.conf.erb +14 -0
  196. data/lib/deprec/templates/starling/starling-init-script.erb +71 -0
  197. data/lib/deprec/templates/subversion/svn.apache.vhost.erb +43 -0
  198. data/lib/deprec/templates/syslog/syslog.conf.erb +71 -0
  199. data/lib/deprec/templates/syslog/syslogd.erb +13 -0
  200. data/lib/deprec/templates/trac/apache_vhost.conf.erb +24 -0
  201. data/lib/deprec/templates/trac/nginx_vhost.conf.erb +26 -0
  202. data/lib/deprec/templates/trac/trac.ini.erb +169 -0
  203. data/lib/deprec/templates/trac/trac_deprec.png +0 -0
  204. data/lib/deprec/templates/trac/tracd-init.erb +43 -0
  205. data/lib/deprec/templates/trac/users.htdigest.erb +0 -0
  206. data/lib/deprec/templates/tsung/tsung.xml.erb +47 -0
  207. data/lib/deprec/templates/vnstat/config.php +57 -0
  208. data/lib/deprec/templates/wordpress/apache2_wordpress_vhost.conf.erb +31 -0
  209. data/lib/deprec/templates/wordpress/wp-config.php.erb +31 -0
  210. data/lib/deprec/templates/wpmu/apache_vhost.conf.erb +13 -0
  211. data/lib/deprec/templates/xen/network-bridge-wrapper +3 -0
  212. data/lib/deprec/templates/xen/xend-config.sxp.erb +195 -0
  213. data/lib/deprec/templates/xen/xend-init.erb +57 -0
  214. data/lib/deprec/templates/xen/xendomains.erb +137 -0
  215. data/lib/deprec/templates/xentools/100-ubuntu-setup +26 -0
  216. data/lib/deprec/templates/xentools/15-disable-hwclock +40 -0
  217. data/lib/deprec/templates/xentools/30-disable-gettys +57 -0
  218. data/lib/deprec/templates/xentools/31-ubuntu-setup +32 -0
  219. data/lib/deprec/templates/xentools/40-setup-networking +145 -0
  220. data/lib/deprec/templates/xentools/98-custom +17 -0
  221. data/lib/deprec/templates/xentools/xen-tools.conf.erb +278 -0
  222. data/lib/deprec/templates/xentools/xm.tmpl.erb +138 -0
  223. data/lib/deprec_cmd_completion.sh +26 -0
  224. data/lib/deprec_minus_rails.rb +12 -0
  225. data/lib/vmbuilder_plugins/all.rb +20 -0
  226. data/lib/vmbuilder_plugins/apt.rb +93 -0
  227. data/lib/vmbuilder_plugins/emerge.rb +76 -0
  228. data/lib/vmbuilder_plugins/gem.rb +100 -0
  229. data/lib/vmbuilder_plugins/std.rb +203 -0
  230. metadata +304 -0
@@ -0,0 +1,4 @@
1
+ # Set ENABLED to 1 if you want the init script to start haproxy.
2
+ ENABLED=1
3
+ # Add extra flags here.
4
+ EXTRAOPTS="<% mysql_proxy_backend_servers.each do |srv| %> --proxy-backend-addresses=<%= srv %><% end %><% mysql_proxy_read_only_backend_servers.each do |srv| %> --proxy-read-only-backend-address=<%= srv %><% end %>"
@@ -0,0 +1,32 @@
1
+ =========================
2
+ SAMPLE CONFIG FILE README
3
+ =========================
4
+
5
+ This directory contains *sample* configuration files for Nagios.
6
+ You should read the HTML documentation for information on
7
+ customizing these config files to suit your needs.
8
+
9
+ A description of the sample config files and subdirectories
10
+ contained here follows:
11
+
12
+
13
+
14
+ CONTENTS:
15
+ ---------
16
+
17
+ cgi.cfg - This is a sample CGI config file
18
+
19
+ nagios.cfg - This is a sample main config file
20
+
21
+ resource.cfg - This is a sample resource config file, used for definining
22
+ custom macros, storing sensitive data, etc.
23
+
24
+ httpd.conf - This file contains sample snippets that you'll need to
25
+ include in your Apache web server config file if you want
26
+ to use the web interface.
27
+
28
+ template-object/ - This directory contains sample object config files. You'll
29
+ need to define object config files like these before you can
30
+ actually start to monitor anything.
31
+
32
+
@@ -0,0 +1,357 @@
1
+ #################################################################
2
+ #
3
+ # CGI.CFG - Sample CGI Configuration File for Nagios 3.2.0
4
+ #
5
+ # Last Modified: 06-17-2009
6
+ #
7
+ #################################################################
8
+
9
+
10
+ # MAIN CONFIGURATION FILE
11
+ # This tells the CGIs where to find your main configuration file.
12
+ # The CGIs will read the main and host config files for any other
13
+ # data they might need.
14
+
15
+ main_config_file=/usr/local/nagios/etc/nagios.cfg
16
+
17
+
18
+
19
+ # PHYSICAL HTML PATH
20
+ # This is the path where the HTML files for Nagios reside. This
21
+ # value is used to locate the logo images needed by the statusmap
22
+ # and statuswrl CGIs.
23
+
24
+ physical_html_path=/usr/local/nagios/share
25
+
26
+
27
+
28
+ # URL HTML PATH
29
+ # This is the path portion of the URL that corresponds to the
30
+ # physical location of the Nagios HTML files (as defined above).
31
+ # This value is used by the CGIs to locate the online documentation
32
+ # and graphics. If you access the Nagios pages with an URL like
33
+ # http://www.myhost.com/nagios, this value should be '/nagios'
34
+ # (without the quotes).
35
+
36
+ url_html_path=/nagios
37
+
38
+
39
+
40
+ # CONTEXT-SENSITIVE HELP
41
+ # This option determines whether or not a context-sensitive
42
+ # help icon will be displayed for most of the CGIs.
43
+ # Values: 0 = disables context-sensitive help
44
+ # 1 = enables context-sensitive help
45
+
46
+ show_context_help=0
47
+
48
+
49
+
50
+ # PENDING STATES OPTION
51
+ # This option determines what states should be displayed in the web
52
+ # interface for hosts/services that have not yet been checked.
53
+ # Values: 0 = leave hosts/services that have not been check yet in their original state
54
+ # 1 = mark hosts/services that have not been checked yet as PENDING
55
+
56
+ use_pending_states=1
57
+
58
+
59
+
60
+
61
+ # AUTHENTICATION USAGE
62
+ # This option controls whether or not the CGIs will use any
63
+ # authentication when displaying host and service information, as
64
+ # well as committing commands to Nagios for processing.
65
+ #
66
+ # Read the HTML documentation to learn how the authorization works!
67
+ #
68
+ # NOTE: It is a really *bad* idea to disable authorization, unless
69
+ # you plan on removing the command CGI (cmd.cgi)! Failure to do
70
+ # so will leave you wide open to kiddies messing with Nagios and
71
+ # possibly hitting you with a denial of service attack by filling up
72
+ # your drive by continuously writing to your command file!
73
+ #
74
+ # Setting this value to 0 will cause the CGIs to *not* use
75
+ # authentication (bad idea), while any other value will make them
76
+ # use the authentication functions (the default).
77
+
78
+ use_authentication=1
79
+
80
+
81
+
82
+
83
+ # x509 CERT AUTHENTICATION
84
+ # When enabled, this option allows you to use x509 cert (SSL)
85
+ # authentication in the CGIs. This is an advanced option and should
86
+ # not be enabled unless you know what you're doing.
87
+
88
+ use_ssl_authentication=0
89
+
90
+
91
+
92
+
93
+ # DEFAULT USER
94
+ # Setting this variable will define a default user name that can
95
+ # access pages without authentication. This allows people within a
96
+ # secure domain (i.e., behind a firewall) to see the current status
97
+ # without authenticating. You may want to use this to avoid basic
98
+ # authentication if you are not using a secure server since basic
99
+ # authentication transmits passwords in the clear.
100
+ #
101
+ # Important: Do not define a default username unless you are
102
+ # running a secure web server and are sure that everyone who has
103
+ # access to the CGIs has been authenticated in some manner! If you
104
+ # define this variable, anyone who has not authenticated to the web
105
+ # server will inherit all rights you assign to this user!
106
+
107
+ #default_user_name=guest
108
+
109
+
110
+
111
+ # SYSTEM/PROCESS INFORMATION ACCESS
112
+ # This option is a comma-delimited list of all usernames that
113
+ # have access to viewing the Nagios process information as
114
+ # provided by the Extended Information CGI (extinfo.cgi). By
115
+ # default, *no one* has access to this unless you choose to
116
+ # not use authorization. You may use an asterisk (*) to
117
+ # authorize any user who has authenticated to the web server.
118
+
119
+ authorized_for_system_information=nagiosadmin
120
+
121
+
122
+
123
+ # CONFIGURATION INFORMATION ACCESS
124
+ # This option is a comma-delimited list of all usernames that
125
+ # can view ALL configuration information (hosts, commands, etc).
126
+ # By default, users can only view configuration information
127
+ # for the hosts and services they are contacts for. You may use
128
+ # an asterisk (*) to authorize any user who has authenticated
129
+ # to the web server.
130
+
131
+ authorized_for_configuration_information=nagiosadmin
132
+
133
+
134
+
135
+ # SYSTEM/PROCESS COMMAND ACCESS
136
+ # This option is a comma-delimited list of all usernames that
137
+ # can issue shutdown and restart commands to Nagios via the
138
+ # command CGI (cmd.cgi). Users in this list can also change
139
+ # the program mode to active or standby. By default, *no one*
140
+ # has access to this unless you choose to not use authorization.
141
+ # You may use an asterisk (*) to authorize any user who has
142
+ # authenticated to the web server.
143
+
144
+ authorized_for_system_commands=nagiosadmin
145
+
146
+
147
+
148
+ # GLOBAL HOST/SERVICE VIEW ACCESS
149
+ # These two options are comma-delimited lists of all usernames that
150
+ # can view information for all hosts and services that are being
151
+ # monitored. By default, users can only view information
152
+ # for hosts or services that they are contacts for (unless you
153
+ # you choose to not use authorization). You may use an asterisk (*)
154
+ # to authorize any user who has authenticated to the web server.
155
+
156
+
157
+ authorized_for_all_services=nagiosadmin
158
+ authorized_for_all_hosts=nagiosadmin
159
+
160
+
161
+
162
+ # GLOBAL HOST/SERVICE COMMAND ACCESS
163
+ # These two options are comma-delimited lists of all usernames that
164
+ # can issue host or service related commands via the command
165
+ # CGI (cmd.cgi) for all hosts and services that are being monitored.
166
+ # By default, users can only issue commands for hosts or services
167
+ # that they are contacts for (unless you you choose to not use
168
+ # authorization). You may use an asterisk (*) to authorize any
169
+ # user who has authenticated to the web server.
170
+
171
+ authorized_for_all_service_commands=nagiosadmin
172
+ authorized_for_all_host_commands=nagiosadmin
173
+
174
+
175
+
176
+ # READ-ONLY USERS
177
+ # A comma-delimited list of usernames that have read-only rights in
178
+ # the CGIs. This will block any service or host commands normally shown
179
+ # on the extinfo CGI pages. It will also block comments from being shown
180
+ # to read-only users.
181
+
182
+ #authorized_for_read_only=user1,user2
183
+
184
+
185
+
186
+
187
+ # STATUSMAP BACKGROUND IMAGE
188
+ # This option allows you to specify an image to be used as a
189
+ # background in the statusmap CGI. It is assumed that the image
190
+ # resides in the HTML images path (i.e. /usr/local/nagios/share/images).
191
+ # This path is automatically determined by appending "/images"
192
+ # to the path specified by the 'physical_html_path' directive.
193
+ # Note: The image file may be in GIF, PNG, JPEG, or GD2 format.
194
+ # However, I recommend that you convert your image to GD2 format
195
+ # (uncompressed), as this will cause less CPU load when the CGI
196
+ # generates the image.
197
+
198
+ #statusmap_background_image=smbackground.gd2
199
+
200
+
201
+
202
+
203
+ # STATUSMAP TRANSPARENCY INDEX COLOR
204
+ # These options set the r,g,b values of the background color used the statusmap CGI,
205
+ # so normal browsers that can't show real png transparency set the desired color as
206
+ # a background color instead (to make it look pretty).
207
+ # Defaults to white: (R,G,B) = (255,255,255).
208
+
209
+ #color_transparency_index_r=255
210
+ #color_transparency_index_g=255
211
+ #color_transparency_index_b=255
212
+
213
+
214
+
215
+
216
+ # DEFAULT STATUSMAP LAYOUT METHOD
217
+ # This option allows you to specify the default layout method
218
+ # the statusmap CGI should use for drawing hosts. If you do
219
+ # not use this option, the default is to use user-defined
220
+ # coordinates. Valid options are as follows:
221
+ # 0 = User-defined coordinates
222
+ # 1 = Depth layers
223
+ # 2 = Collapsed tree
224
+ # 3 = Balanced tree
225
+ # 4 = Circular
226
+ # 5 = Circular (Marked Up)
227
+
228
+ default_statusmap_layout=5
229
+
230
+
231
+
232
+ # DEFAULT STATUSWRL LAYOUT METHOD
233
+ # This option allows you to specify the default layout method
234
+ # the statuswrl (VRML) CGI should use for drawing hosts. If you
235
+ # do not use this option, the default is to use user-defined
236
+ # coordinates. Valid options are as follows:
237
+ # 0 = User-defined coordinates
238
+ # 2 = Collapsed tree
239
+ # 3 = Balanced tree
240
+ # 4 = Circular
241
+
242
+ default_statuswrl_layout=4
243
+
244
+
245
+
246
+ # STATUSWRL INCLUDE
247
+ # This option allows you to include your own objects in the
248
+ # generated VRML world. It is assumed that the file
249
+ # resides in the HTML path (i.e. /usr/local/nagios/share).
250
+
251
+ #statuswrl_include=myworld.wrl
252
+
253
+
254
+
255
+ # PING SYNTAX
256
+ # This option determines what syntax should be used when
257
+ # attempting to ping a host from the WAP interface (using
258
+ # the statuswml CGI. You must include the full path to
259
+ # the ping binary, along with all required options. The
260
+ # $HOSTADDRESS$ macro is substituted with the address of
261
+ # the host before the command is executed.
262
+ # Please note that the syntax for the ping binary is
263
+ # notorious for being different on virtually ever *NIX
264
+ # OS and distribution, so you may have to tweak this to
265
+ # work on your system.
266
+
267
+ ping_syntax=/bin/ping -n -U -c 5 $HOSTADDRESS$
268
+
269
+
270
+
271
+ # REFRESH RATE
272
+ # This option allows you to specify the refresh rate in seconds
273
+ # of various CGIs (status, statusmap, extinfo, and outages).
274
+
275
+ refresh_rate=90
276
+
277
+
278
+
279
+ # ESCAPE HTML TAGS
280
+ # This option determines whether HTML tags in host and service
281
+ # status output is escaped in the web interface. If enabled,
282
+ # your plugin output will not be able to contain clickable links.
283
+
284
+ escape_html_tags=1
285
+
286
+
287
+
288
+
289
+ # SOUND OPTIONS
290
+ # These options allow you to specify an optional audio file
291
+ # that should be played in your browser window when there are
292
+ # problems on the network. The audio files are used only in
293
+ # the status CGI. Only the sound for the most critical problem
294
+ # will be played. Order of importance (higher to lower) is as
295
+ # follows: unreachable hosts, down hosts, critical services,
296
+ # warning services, and unknown services. If there are no
297
+ # visible problems, the sound file optionally specified by
298
+ # 'normal_sound' variable will be played.
299
+ #
300
+ #
301
+ # <varname>=<sound_file>
302
+ #
303
+ # Note: All audio files must be placed in the /media subdirectory
304
+ # under the HTML path (i.e. /usr/local/nagios/share/media/).
305
+
306
+ #host_unreachable_sound=hostdown.wav
307
+ #host_down_sound=hostdown.wav
308
+ #service_critical_sound=critical.wav
309
+ #service_warning_sound=warning.wav
310
+ #service_unknown_sound=warning.wav
311
+ #normal_sound=noproblem.wav
312
+
313
+
314
+
315
+ # URL TARGET FRAMES
316
+ # These options determine the target frames in which notes and
317
+ # action URLs will open.
318
+
319
+ action_url_target=_blank
320
+ notes_url_target=_blank
321
+
322
+
323
+
324
+
325
+ # LOCK AUTHOR NAMES OPTION
326
+ # This option determines whether users can change the author name
327
+ # when submitting comments, scheduling downtime. If disabled, the
328
+ # author names will be locked into their contact name, as defined in Nagios.
329
+ # Values: 0 = allow editing author names
330
+ # 1 = lock author names (disallow editing)
331
+
332
+ lock_author_names=1
333
+
334
+
335
+
336
+
337
+ # SPLUNK INTEGRATION OPTIONS
338
+ # These options allow you to enable integration with Splunk
339
+ # in the web interface. If enabled, you'll be presented with
340
+ # "Splunk It" links in various places in the CGIs (log file,
341
+ # alert history, host/service detail, etc). Useful if you're
342
+ # trying to research why a particular problem occurred.
343
+ # For more information on Splunk, visit http://www.splunk.com/
344
+
345
+ # This option determines whether the Splunk integration is enabled
346
+ # Values: 0 = disable Splunk integration
347
+ # 1 = enable Splunk integration
348
+
349
+ #enable_splunk_integration=1
350
+
351
+
352
+ # This option should be the URL used to access your instance of Splunk
353
+
354
+ #splunk_url=http://127.0.0.1:8000/
355
+
356
+
357
+
@@ -0,0 +1,118 @@
1
+ #!/usr/bin/perl
2
+ use strict;
3
+ use warnings;
4
+ use Getopt::Long;
5
+ use File::Basename;
6
+
7
+ # Author: Dean Wilson ; License: GPL
8
+ # Project Home: http://www.unixdaemon.net/
9
+ # For documentation look at the bottom of this file, or run with '-h'
10
+ # Version 0.5 - Tided up arg handling. Added usage
11
+
12
+ # Changes:
13
+ # Usage information corrected, thanks to Bartlomiej Konarski
14
+
15
+ # nagios requires a 3 for unknown errors.
16
+ $SIG{__DIE__} = sub {
17
+ print @_;
18
+ exit 3;
19
+ };
20
+
21
+ my $app = basename($0);
22
+
23
+ GetOptions(
24
+ "w|warn=s" => \( my $warn_percent = 30 ),
25
+ "c|crit=s" => \( my $crit_percent = 20 ),
26
+ "h|help" => \&usage,
27
+ );
28
+
29
+ # remove any % passed in
30
+ $warn_percent =~ s/%//;
31
+ $crit_percent =~ s/%//;
32
+
33
+ die "Warning value must be larger than critical value\n"
34
+ unless $warn_percent >= $crit_percent;
35
+
36
+ my $memory_stats_ref = get_mem();
37
+ my $percentage_free = get_percentage($memory_stats_ref);
38
+
39
+ if ($percentage_free <= $crit_percent) {
40
+ print "CRIT: Only $percentage_free% ($memory_stats_ref->{free_cache}M) of memory free!\n";
41
+ exit 2;
42
+ } elsif ($percentage_free <= $warn_percent) {
43
+ print "WARN: Only $percentage_free% ($memory_stats_ref->{free_cache}M) of memory free!\n";
44
+ exit 1;
45
+ } else {
46
+ print "OK: $percentage_free% ($memory_stats_ref->{free_cache}M) free memory.\n";
47
+ exit 0;
48
+ }
49
+
50
+ #########################################
51
+
52
+ sub get_mem {
53
+ # get the two values from the free command.
54
+ # return them as a hash ref
55
+
56
+ my %memory_stats;
57
+
58
+ open(FREEPIPE, "free -m |")
59
+ || die "Failed to open 'free'\n$!\n";
60
+
61
+ while(<FREEPIPE>) {
62
+ chomp;
63
+ next unless m!buffers/cache:!;
64
+ m/[^\d]+(\d+)\s+(\d+)$/;
65
+ $memory_stats{'used_cache'} = $1;
66
+ $memory_stats{'free_cache'} = $2;
67
+ }
68
+
69
+ close FREEPIPE;
70
+
71
+ return \%memory_stats;
72
+ }
73
+
74
+ #------------------------------------------#
75
+
76
+ sub get_percentage {
77
+ my $mem_stats_ref = shift;
78
+ my $percentage_free;
79
+
80
+ my $total = $mem_stats_ref->{'used_cache'} + $mem_stats_ref->{'free_cache'};
81
+ $percentage_free = int (($mem_stats_ref->{'free_cache'} / $total) * 100);
82
+
83
+ return $percentage_free;
84
+ }
85
+
86
+ #------------------------------------------#
87
+
88
+ sub usage {
89
+ print<<EOU;
90
+
91
+ $app - Copyright (c) 2006 Dean Wilson. Licensed under the GPL
92
+
93
+ This script reports the percentage of memory that's still free along
94
+ with a warning or a critical based upon user defined threshholds.
95
+
96
+ This script was written to be used in conjunction with Nagios.
97
+
98
+ Usage Examples:
99
+ $app -w 20 -c 10
100
+ $app -warn 30 -crit 15
101
+ $app -h # shows this information
102
+
103
+ Options:
104
+ -w | -warn
105
+ Warn if less than this percentage is free.
106
+ -c | -crit
107
+ Crit if less than this percentage is free.
108
+ -h
109
+ This help and usage information
110
+
111
+ Notes:
112
+ The output format of "free" (which this script wraps) can change
113
+ between releases. Please double check the outputs before you deploy
114
+ this script.
115
+
116
+ EOU
117
+ exit 3;
118
+ }