nagios.txt 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. <file name="apache.conf">
  2. ##
  3. ## apache.conf -- Nagios Apache Virtual Host Configuration
  4. ##
  5. ScriptAlias /nagios/cgi @l_prefix@/cgi/nagios
  6. Alias /nagios @l_prefix@/share/nagios
  7. <Directory "@l_prefix@/cgi/nagios">
  8. Options ExecCGI
  9. AllowOverride None
  10. Order allow,deny
  11. Allow from all
  12. AuthName "Nagios Access"
  13. AuthType Basic
  14. AuthUserFile @l_prefix@/etc/nagios/apache.passwd
  15. Require valid-user
  16. </Directory>
  17. <Directory "@l_prefix@/share/nagios">
  18. Options None
  19. AllowOverride None
  20. Order allow,deny
  21. Allow from all
  22. AuthName "Nagios Access"
  23. AuthType Basic
  24. AuthUserFile @l_prefix@/etc/nagios/apache.passwd
  25. Require valid-user
  26. </Directory>
  27. </file>
  28. <file name="apache.passwd">
  29. nagios:4EFwh7XjC40.k
  30. </file>
  31. <file name="cgi.cfg">
  32. ##
  33. ## cgi.cfg -- Nagios CGI Configuration
  34. ##
  35. #
  36. # Nagios Master
  37. #
  38. main_config_file=@l_prefix@/etc/nagios/nagios.cfg
  39. nagios_check_command=@l_prefix@/libexec/nagios/check_nagios @l_prefix@/var/nagios/run/nagios.status 5 '@l_prefix@/bin/nagios'
  40. #
  41. # Interface
  42. #
  43. physical_html_path=@l_prefix@/web/nagios
  44. url_html_path=/nagios
  45. show_context_help=1
  46. refresh_rate=90
  47. #
  48. # Authentication
  49. #
  50. use_authentication=1
  51. #default_user_name=guest
  52. #authorized_for_system_information=nagios
  53. #authorized_for_configuration_information=nagios
  54. #authorized_for_system_commands=nagios
  55. #authorized_for_all_services=nagios,guest
  56. #authorized_for_all_hosts=nagios,guest
  57. #authorized_for_all_service_commands=nagios
  58. #authorized_for_all_host_commands=nagios
  59. #
  60. # Status Map Rendering
  61. #
  62. default_statusmap_layout=5
  63. default_statuswrl_layout=4
  64. #statusmap_background_image=smbackground.gd2
  65. #statuswrl_include=myworld.wrl
  66. #host_unreachable_sound=hostdown.wav
  67. #host_down_sound=hostdown.wav
  68. #service_critical_sound=critical.wav
  69. #service_warning_sound=warning.wav
  70. #service_unknown_sound=warning.wav
  71. ping_syntax=@l_prefix@/bin/gping -n -c 5 $HOSTADDRESS$
  72. </file>
  73. <file name="nagios.cfg">
  74. ##
  75. ## nagios.cfg -- Nagios Master Configuration
  76. ##
  77. #
  78. # Global
  79. #
  80. nagios_user=@l_rusr@
  81. nagios_group=@l_ngrp@
  82. use_syslog=0
  83. daemon_dumps_core=0
  84. status_file=@l_prefix@/var/nagios/run/nagios.status
  85. object_cache_file=@l_prefix@/var/nagios/run/nagios.cache
  86. temp_file=@l_prefix@/var/nagios/log/nagios.tmp
  87. lock_file=@l_prefix@/var/nagios/run/nagios.pid
  88. admin_email=@l_musr@
  89. admin_pager=@l_musr@
  90. p1_file=@l_prefix@/libexec/nagios/p1.pl
  91. #
  92. # Logging
  93. #
  94. state_retention_file=@l_prefix@/var/nagios/log/retention.log
  95. log_file=@l_prefix@/var/nagios/log/nagios.log
  96. log_rotation_method=d
  97. log_archive_path=@l_prefix@/var/nagios/log
  98. log_notifications=1
  99. log_service_retries=1
  100. log_host_retries=1
  101. log_event_handlers=1
  102. log_initial_states=0
  103. log_external_commands=1
  104. log_passive_checks=1
  105. #
  106. # Resource Configuration
  107. #
  108. resource_file=@l_prefix@/etc/nagios/resource.cfg
  109. #
  110. # Object Configurations
  111. #
  112. cfg_file=@l_prefix@/etc/nagios/commands.cfg
  113. cfg_file=@l_prefix@/etc/nagios/contacts.cfg
  114. cfg_file=@l_prefix@/etc/nagios/timeperiods.cfg
  115. cfg_file=@l_prefix@/etc/nagios/hosts.cfg
  116. cfg_file=@l_prefix@/etc/nagios/services.cfg
  117. #
  118. # External Command Queue
  119. #
  120. check_external_commands=1
  121. command_check_interval=1s
  122. command_file=@l_prefix@/var/nagios/cmd/nagios.cmd
  123. #
  124. # Event Brokers
  125. #
  126. event_broker_options=-1
  127. #broker_module=/somewhere/module1.o
  128. #broker_module=/somewhere/module2.o arg1 arg2=3 debug=0
  129. #
  130. # Global Host and Service Event Handlers
  131. #
  132. #global_host_event_handler=somecommand
  133. #global_service_event_handler=somecommand
  134. #
  135. # State Retention
  136. #
  137. retain_state_information=1
  138. state_retention_file=@l_prefix@/var/nagios/run/nagios.state
  139. retention_update_interval=60
  140. use_retained_program_state=1
  141. use_retained_scheduling_info=0
  142. #
  143. # Performance Logging
  144. #
  145. process_performance_data=0
  146. #host_perfdata_command=process-host-perfdata
  147. #service_perfdata_command=process-service-perfdata
  148. #host_perfdata_file=/tmp/host-perfdata
  149. #service_perfdata_file=/tmp/service-perfdata
  150. #host_perfdata_file_template=[HOSTPERFDATA]\t$TIMET$\t$HOSTNAME$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$
  151. #service_perfdata_file_template=[SERVICEPERFDATA]\t$TIMET$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$
  152. #host_perfdata_file_mode=a
  153. #service_perfdata_file_mode=a
  154. #host_perfdata_file_processing_interval=0
  155. #service_perfdata_file_processing_interval=0
  156. #host_perfdata_file_processing_command=process-host-perfdata-file
  157. #service_perfdata_file_processing_command=process-service-perfdata-file
  158. #
  159. # Operation Options
  160. #
  161. service_inter_check_delay_method=s
  162. max_service_check_spread=30
  163. service_interleave_factor=s
  164. host_inter_check_delay_method=s
  165. max_host_check_spread=30
  166. max_concurrent_checks=0
  167. check_result_reaper_frequency=10
  168. auto_reschedule_checks=0
  169. auto_rescheduling_interval=30
  170. auto_rescheduling_window=180
  171. sleep_time=0.25
  172. service_check_timeout=60
  173. host_check_timeout=30
  174. event_handler_timeout=30
  175. notification_timeout=30
  176. ocsp_timeout=5
  177. perfdata_timeout=5
  178. interval_length=60
  179. use_aggressive_host_checking=0
  180. execute_service_checks=1
  181. accept_passive_service_checks=1
  182. execute_host_checks=1
  183. accept_passive_host_checks=1
  184. enable_notifications=1
  185. enable_event_handlers=1
  186. obsess_over_services=0
  187. #ocsp_command=somecommand
  188. check_for_orphaned_services=0
  189. check_service_freshness=1
  190. service_freshness_check_interval=60
  191. check_host_freshness=0
  192. host_freshness_check_interval=60
  193. status_update_interval=15
  194. enable_flap_detection=0
  195. low_service_flap_threshold=5.0
  196. high_service_flap_threshold=20.0
  197. low_host_flap_threshold=5.0
  198. high_host_flap_threshold=20.0
  199. date_format=iso8601
  200. illegal_object_name_chars=`~!$%^&*|'"<>?,()=
  201. illegal_macro_output_chars=`~$&|'"<>
  202. use_regexp_matching=0
  203. use_true_regexp_matching=0
  204. </file>
  205. <file name="contacts.cfg">
  206. ##
  207. ## contacts.cfg -- Nagios Contact Definitions
  208. ##
  209. define contactgroup {
  210. contactgroup_name unix-admins
  211. alias Unix Administrators
  212. members nagios
  213. }
  214. define contact {
  215. contact_name nagios
  216. alias Nagios Administrator
  217. service_notification_period 24x7
  218. host_notification_period 24x7
  219. service_notification_options w,u,c,r
  220. host_notification_options d,u,r
  221. service_notification_commands serv-notify-by-email,serv-notify-by-epager
  222. host_notification_commands host-notify-by-email,host-notify-by-epager
  223. email nagios-admin@example.com
  224. pager nagios-admin+sms@example.com
  225. }
  226. define command {
  227. command_name serv-notify-by-email
  228. command_line @l_prefix@/bin/gprintf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | @l_prefix@/bin/mail -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
  229. }
  230. define command {
  231. command_name serv-notify-by-epager
  232. command_line @l_prefix@/bin/gprintf "%b" "Service: $SERVICEDESC$\nHost: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nInfo: $SERVICEOUTPUT$\nDate: $LONGDATETIME$" | @l_prefix@/bin/mail -s "$NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" $CONTACTPAGER$
  233. }
  234. define command {
  235. command_name host-notify-by-email
  236. command_line @l_prefix@/bin/gprintf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | @l_prefix@/bin/mail -s "Host $HOSTSTATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$
  237. }
  238. define command {
  239. command_name host-notify-by-epager
  240. command_line @l_prefix@/bin/gprintf "%b" "Host '$HOSTALIAS$' is $HOSTSTATE$\nInfo: $HOSTOUTPUT$\nTime: $LONGDATETIME$" | @l_prefix@/bin/mail -s "$NOTIFICATIONTYPE$ alert - Host $HOSTNAME$ is $HOSTSTATE$" $CONTACTPAGER$
  241. }
  242. </file>
  243. <file name="commands.cfg">
  244. ##
  245. ## commands.cfg -- Nagios Command Definitions
  246. ##
  247. #
  248. # Special Checks
  249. #
  250. define command {
  251. command_name check_host_alive
  252. command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 1
  253. }
  254. #
  255. # Local System Checks
  256. #
  257. define command {
  258. command_name check_local_disk
  259. command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
  260. }
  261. define command {
  262. command_name check_local_load
  263. command_line $USER1$/check_load -w $ARG1$ -c $ARG2$
  264. }
  265. define command {
  266. command_name check_local_users
  267. command_line $USER1$/check_users -w $ARG1$ -c $ARG2$
  268. }
  269. define command {
  270. command_name check_local_procs
  271. command_line $USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$
  272. }
  273. #
  274. # Remote System Checks
  275. #
  276. define command {
  277. command_name check_snmp_disk
  278. command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o UCD-SNMP-MIB::dskAvail.$ARG1$,UCD-SNMP-MIB::dskPercent.$ARG1$ -w $ARG2$:,:$ARG3$ -c $ARG4$:,:$ARG5$ -u 'kB free (','% used)' -l 'disk space'
  279. }
  280. define command {
  281. command_name check_snmp_load
  282. command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o UCD-SNMP-MIB::laLoadInt.1,UCD-SNMP-MIB::laLoadInt.2,UCD-SNMP-MIB::laLoadInt.3 -w :$ARG2$,:$ARG3$,:$ARG4$ -w :$ARG5$,:$ARG6$,:$ARG7$ -l load
  283. }
  284. define command {
  285. command_name check_snmp_users
  286. command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o host.hrSystem.hrSystemNumUsers -w :$ARG2$ -c :$ARG3$ -l users
  287. }
  288. define command {
  289. command_name check_snmp_procs
  290. command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -o host.hrSystem.hrSystemProcesses -w :$ARG2$ -c :$ARG3$ -l processes
  291. }
  292. #
  293. # Remote Network Service Checks
  294. #
  295. define command {
  296. command_name check_net_ping
  297. command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
  298. }
  299. define command {
  300. command_name check_net_ping_fast
  301. command_line $USER1$/check_fping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5
  302. }
  303. define command {
  304. command_name check_net_tcp
  305. command_line $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$
  306. }
  307. define command {
  308. command_name check_net_udp
  309. command_line $USER1$/check_udp -H $HOSTADDRESS$ -p $ARG1$
  310. }
  311. define command {
  312. command_name check_net_dns
  313. command_line $USER1$/check_dns -H $ARG1$ -s $HOSTADDRESS$
  314. }
  315. define command {
  316. command_name check_net_http
  317. command_line $USER1$/check_http -H $HOSTADDRESS$ -I $HOSTADDRESS$ -w $ARG1$ -c $ARG2$
  318. }
  319. </file>
  320. <file name="hosts.cfg">
  321. ##
  322. ## hosts.cfg -- Nagios Hosts Definitions
  323. ##
  324. #
  325. # Host Groups
  326. #
  327. define hostgroup {
  328. hostgroup_name unix-servers
  329. alias Unix Servers
  330. members localhost
  331. }
  332. #
  333. # Host Template
  334. #
  335. define host {
  336. name generic-host
  337. register 0
  338. notifications_enabled 1
  339. event_handler_enabled 1
  340. flap_detection_enabled 1
  341. process_perf_data 1
  342. retain_status_information 1
  343. retain_nonstatus_information 1
  344. }
  345. #
  346. # Host Definitions
  347. #
  348. define host {
  349. use generic-host
  350. host_name localhost
  351. alias Local Unix Host
  352. address 127.0.0.1
  353. check_command check_host_alive
  354. max_check_attempts 10
  355. notification_interval 480
  356. notification_period 24x7
  357. notification_options d,u,r
  358. contact_groups unix-admins
  359. }
  360. </file>
  361. <file name="resource.cfg">
  362. ##
  363. ## resource.cfg -- Nagios Resource Definitions
  364. ##
  365. # You can define $USERx$ macros in this file, which can in turn be
  366. # used in command definitions in your host config file(s). $USERx$
  367. # macros are useful for storing sensitive information such as
  368. # usernames, passwords, etc. They are also handy for specifying the
  369. # path to plugins and event handlers - if you decide to move the
  370. # plugins or event handlers to a different directory in the future,
  371. # you can just update one or two $USERx$ macros, instead of modifying
  372. # a lot of command definitions. The CGIs will not attempt to read the
  373. # contents of resource files, so you can set restrictive permissions
  374. # (600 or 660) on them. Nagios supports up to 32 $USERx$ macros
  375. # ($USER1$ through $USER32$)
  376. $USER1$=@l_prefix@/libexec/nagios
  377. # $USER2$=@l_prefix@/libexec/nagios/eventhandlers
  378. # $USER3$=myusername
  379. # $USER4$=mypassword
  380. </file>
  381. <file name="services.cfg">
  382. ##
  383. ## services.cfg -- Nagios Services Definitions
  384. ##
  385. #
  386. # Service Template
  387. #
  388. define service {
  389. name generic-service
  390. register 0
  391. active_checks_enabled 1
  392. passive_checks_enabled 1
  393. parallelize_check 1
  394. obsess_over_service 1
  395. check_freshness 0
  396. notifications_enabled 1
  397. event_handler_enabled 1
  398. flap_detection_enabled 1
  399. process_perf_data 1
  400. retain_status_information 1
  401. retain_nonstatus_information 1
  402. }
  403. #
  404. # Service Definitions
  405. #
  406. define service {
  407. use generic-service
  408. host_name localhost
  409. service_description Root Filesystem Partition
  410. is_volatile 0
  411. check_period 24x7
  412. max_check_attempts 3
  413. normal_check_interval 5
  414. retry_check_interval 1
  415. contact_groups unix-admins
  416. notification_interval 120
  417. notification_period 24x7
  418. notification_options w,u,c,r
  419. check_command check_local_disk!20%!10%!/
  420. }
  421. define service {
  422. use generic-service
  423. host_name localhost
  424. service_description System Load
  425. is_volatile 0
  426. check_period 24x7
  427. max_check_attempts 3
  428. normal_check_interval 5
  429. retry_check_interval 1
  430. contact_groups unix-admins
  431. notification_interval 120
  432. notification_period 24x7
  433. notification_options w,u,c,r
  434. check_command check_local_load!5.0,4.0,3.0!10.0,6.0,4.0
  435. }
  436. define service {
  437. use generic-service
  438. host_name localhost
  439. service_description System Users
  440. is_volatile 0
  441. check_period 24x7
  442. max_check_attempts 3
  443. normal_check_interval 5
  444. retry_check_interval 1
  445. contact_groups unix-admins
  446. notification_interval 240
  447. notification_period 24x7
  448. notification_options w,u,c,r
  449. check_command check_local_users!20!50
  450. }
  451. define service {
  452. use generic-service
  453. host_name localhost
  454. service_description System Processes
  455. is_volatile 0
  456. check_period 24x7
  457. max_check_attempts 3
  458. normal_check_interval 5
  459. retry_check_interval 1
  460. contact_groups unix-admins
  461. notification_interval 240
  462. notification_period 24x7
  463. notification_options w,u,c,r
  464. check_command check_local_procs!200!400!RSZDT
  465. }
  466. define service {
  467. use generic-service
  468. host_name localhost
  469. service_description System Reachability
  470. is_volatile 0
  471. check_period 24x7
  472. max_check_attempts 3
  473. normal_check_interval 5
  474. retry_check_interval 1
  475. contact_groups unix-admins
  476. notification_interval 240
  477. notification_period 24x7
  478. notification_options c,r
  479. check_command check_net_ping!100.0,20%!500.0,60%
  480. }
  481. </file>
  482. <file name="timeperiods.cfg">
  483. ##
  484. ## timeperiods.cfg -- Nagios Time Periods Definitions
  485. ##
  486. define timeperiod {
  487. timeperiod_name 24x7
  488. alias 24 Hours A Day, 7 Days A Week
  489. sunday 00:00-24:00
  490. monday 00:00-24:00
  491. tuesday 00:00-24:00
  492. wednesday 00:00-24:00
  493. thursday 00:00-24:00
  494. friday 00:00-24:00
  495. saturday 00:00-24:00
  496. }
  497. define timeperiod {
  498. timeperiod_name workhours
  499. alias "Normal" Working Hours
  500. monday 09:00-17:00
  501. tuesday 09:00-17:00
  502. wednesday 09:00-17:00
  503. thursday 09:00-17:00
  504. friday 09:00-17:00
  505. }
  506. define timeperiod {
  507. timeperiod_name nonworkhours
  508. alias Non-Work Hours
  509. sunday 00:00-24:00
  510. monday 00:00-09:00,17:00-24:00
  511. tuesday 00:00-09:00,17:00-24:00
  512. wednesday 00:00-09:00,17:00-24:00
  513. thursday 00:00-09:00,17:00-24:00
  514. friday 00:00-09:00,17:00-24:00
  515. saturday 00:00-24:00
  516. }
  517. define timeperiod {
  518. timeperiod_name none
  519. alias No Time Is A Good Time
  520. }
  521. </file>