Permalink
Browse files

first commit

  • Loading branch information...
0 parents commit a3b73fe2126ab3fd7dfb60cd892986dcf8c3915d @cdracars committed Apr 19, 2012
0 README
No changes.
20 files/cgi.cfg
@@ -0,0 +1,20 @@
+main_config_file=/etc/nagios3/nagios.cfg
+physical_html_path=/usr/share/nagios3/htdocs
+url_html_path=/nagios3
+show_context_help=1
+use_pending_states=1
+nagios_check_command=/usr/lib/nagios/plugins/check_nagios /var/cache/nagios3/status.dat 5 '/usr/sbin/nagios3'
+use_authentication=1
+use_ssl_authentication=0
+authorized_for_system_information=nagios
+authorized_for_configuration_information=nagios
+authorized_for_system_commands=nagios
+authorized_for_all_services=nagios
+authorized_for_all_hosts=nagios
+authorized_for_all_service_commands=nagios
+authorized_for_all_host_commands=nagios default_statusmap_layout=5
+default_statuswrl_layout=4
+ping_syntax=/bin/ping -n -U -c 5 $HOSTADDRESS$
+refresh_rate=90 escape_html_tags=1
+action_url_target=_blank
+notes_url_target=_blank
24 files/commands.cfg
@@ -0,0 +1,24 @@
+define command {
+command_name check_nrpe
+command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$ $ARG3$ $ARG4$ $ARG5$
+}
+
+define command{
+command_name check-host-alive
+command_line $USER1$/check_ping -H '$HOSTADDRESS$' -w 5000,100% -c 5000,100% -p 1
+}
+
+define command{
+command_name check_all_disks
+command_line /usr/lib/nagios/plugins/check_disk -w '$ARG1$' -c '$ARG2$' -e
+}
+
+define command{
+command_name notify-host-by-email
+command_line /usr/bin/printf "%b" "***** Nagios *****\n\ nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\ nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
+}
+
+define command{
+command_name notify-service-by-email
+command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\ nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\ nAdditionalInfo:\n\n$SERVICEOUTPUT$" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
+}
17 files/contacts.cfg
@@ -0,0 +1,17 @@
+define contact {
+contact_name cdracars
+alias Cody Dracars
+service_notification_period 24x7
+host_notification_period 24x7
+service_notification_options w,u,c,r
+host_notification_options d,r
+service_notification_commands notify-service-by-email
+host_notification_commands notify-host-by-email
+email cdracars@usao.edu
+}
+
+define contactgroup {
+contactgroup_name sysadmin
+alias Sysadmins
+members cdracars
+}
14 files/host_templates.cfg
@@ -0,0 +1,14 @@
+define host{
+name generic_host
+check_command check-host-alive
+max_check_attempts 3
+checks_enabled 1
+failure_prediction_enabled 1
+retain_status_information 1
+retain_nonstatus_information 1
+notification_interval 0
+notification_options d,u,r
+check_interval 300
+contact_groups sysadmin
+register 0
+}
5 files/hostgroups.cfg
@@ -0,0 +1,5 @@
+define hostgroup {
+hostgroup_name all
+alias All Servers
+members *
+}
5 files/hosts.cfg
@@ -0,0 +1,5 @@
+define host {
+host_name usao
+address usao.edu
+use generic_host
+}
1 files/htpasswd.nagios
@@ -0,0 +1 @@
+nagios:$apr1$zv.3AZQ/$wH2E7CXeSFvHeKifzfnsJ0
20 files/nagios.cfg
@@ -0,0 +1,20 @@
+# Config files to read
+cfg_file=/etc/nagios3/commands.cfg
+cfg_file=/etc/nagios3/service_templates.cfg
+cfg_file=/etc/nagios3/host_templates.cfg
+cfg_file=/etc/nagios3/timeperiods.cfg
+cfg_file=/etc/nagios3/contacts.cfg
+cfg_file=/etc/nagios3/hostgroups.cfg
+cfg_file=/etc/nagios3/hosts.cfg
+cfg_file=/etc/nagios3/services.cfg
+# Nagios settings
+log_file=/var/log/nagios3/nagios.log
+illegal_macro_output_chars=`~$&|'"<>
+check_result_path=/var/lib/nagios3/spool/checkresults
+nagios_user=nagios
+nagios_group=nagios
+command_file=/var/lib/nagios3/rw/nagios.cmd
+lock_file=/var/run/nagios3/nagios3.pid
+p1_file=/usr/lib/nagios3/p1.pl
+check_external_commands=1
+resource_file=/etc/nagios3/resource.cfg
24 files/nagios.conf
@@ -0,0 +1,24 @@
+ScriptAlias /cgi-bin/nagios3 /usr/lib/cgi-bin/nagios3
+ScriptAlias /nagios3/cgi-bin /usr/lib/cgi-bin/nagios3
+Alias /nagios3/stylesheets /etc/nagios3/stylesheets
+Alias /nagios3 /usr/share/nagios3/htdocs
+Alias /nagios /usr/share/nagios3/htdocs/
+
+<DirectoryMatch (/usr/share/nagios3/htdocs|/usr/lib/cgi-bin/nagios3|/etc/nagios3/stylesheets)>
+Options FollowSymLinks
+DirectoryIndex index.php index.html
+AllowOverride AuthConfig
+Order Allow,Deny
+Allow From All
+AuthName "Nagios Access"
+AuthType Basic
+AuthUserFile /etc/nagios3/htpasswd.nagios
+require valid-user
+</DirectoryMatch>
+
+<VirtualHost *:80>
+ServerName debian-6.0.4
+ErrorLog /var/log/apache2/nagios-error_log
+CustomLog /var/log/apache2/nagios-access_log common
+DocumentRoot /usr/share/nagios3
+</VirtualHost>
12 files/nrpe.cfg
@@ -0,0 +1,12 @@
+log_facility=daemon
+pid_file=/var/run/nagios/nrpe.pid
+server_port=5666
+nrpe_user=nagios
+nrpe_group=nagios
+allowed_hosts=debian-6.0.4
+dont_blame_nrpe=1
+debug=0
+command_timeout=60
+connection_timeout=300
+command[check_load]=/usr/lib/nagios/plugins/check_load -w $ARG1$ -c $ARG2$
+command[check_all_disks]=/usr/lib/nagios/plugins/check_disk
48 files/service_templates.cfg
@@ -0,0 +1,48 @@
+define service{
+name generic_service ; The 'name' of this service template
+active_checks_enabled 1 ; Active service checks are enabled
+passive_checks_enabled 1 ; Passive service checks are enabled/accepted
+parallelize_check 1 ; Active service checks should be parallelized (disabling this can lead to major performance problems)
+obsess_over_service 1 ; We should obsess over this service (if necessary)
+check_freshness 0 ; Default is to NOT check service 'freshness'
+notifications_enabled 1 ; Service notifications are enabled
+event_handler_enabled 1 ; Service event handler is enabled
+flap_detection_enabled 1 ; Flap detection is enabled
+failure_prediction_enabled 1 ; Failure prediction is enabled
+process_perf_data 1 ; Process performance data
+retain_status_information 1 ; Retain status information across program restarts
+retain_nonstatus_information 1 ; Retain non-status information across program restarts
+notification_interval 0 ; Only send notifications on status change by default. i
+is_volatile 0
+check_period 24x7
+normal_check_interval 5
+retry_check_interval 2
+max_check_attempts 3
+notification_period 24x7
+notification_options c,r
+contact_groups sysadmin
+register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
+}
+
+#Nagios monitoring serverNagios monitoring serverdeploying, steps# Defaults
+define service {
+name every_5_mins
+normal_check_interval 5
+use generic_service
+register 0
+}
+
+define service {
+name every_hour
+normal_check_interval 60
+use generic_service
+register 0
+}
+
+define service {
+name every_day
+normal_check_interval 1440
+use generic_service
+register 0
+}
+
13 files/services.cfg
@@ -0,0 +1,13 @@
+define service {
+hostgroup_name all
+service_description Disk
+check_command check_nrpe!check_all_disks!20%!10%
+use every_day
+}
+
+define service {
+hostgroup_name all
+service_description Load
+check_command check_nrpe!check_load!10,10,10!15,15,15
+use every_hour
+}
11 files/timeperiods.cfg
@@ -0,0 +1,11 @@
+define timeperiod {
+timeperiod_name 24x7
+alias 24 Hours A Day, 7 Days A Week
+sunday 00:00-24:00
+monday 00:00-24:00
+tuesday 00:00-24:00
+wednesday 00:00-24:00
+thursday 00:00-24:00
+friday 00:00-24:00
+saturday 00:00-24:00
+}
169 manifests/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml
@@ -0,0 +1,169 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<workbench progressCount="4" version="2.0">
+<workbenchAdvisor/>
+<window height="768" width="1024" x="0" y="33">
+<fastViewData fastViewLocation="1024"/>
+<perspectiveBar>
+<itemSize x="160"/>
+</perspectiveBar>
+<coolbarLayout>
+<coolItem id="group.file" itemType="typeGroupMarker"/>
+<coolItem id="org.eclipse.ui.workbench.file" itemType="typeToolBarContribution" x="106" y="22"/>
+<coolItem id="additions" itemType="typeGroupMarker"/>
+<coolItem id="org.eclipse.search.searchActionSet" itemType="typeToolBarContribution" x="62" y="22"/>
+<coolItem id="group.nav" itemType="typeGroupMarker"/>
+<coolItem id="org.eclipse.ui.workbench.navigate" itemType="typeToolBarContribution" x="152" y="22"/>
+<coolItem id="group.editor" itemType="typeGroupMarker"/>
+<coolItem id="org.cloudsmith.geppetto.pp.dsl.PP" itemType="typePlaceholder" x="32" y="22"/>
+<coolItem id="group.help" itemType="typeGroupMarker"/>
+<coolItem id="org.eclipse.ui.workbench.help" itemType="typeToolBarContribution" x="-1" y="-1"/>
+</coolbarLayout>
+<page aggregateWorkingSetId="Aggregate for window 1330549857408" focus="true" label="Workspace - Resource">
+<editors>
+<editorArea activeWorkbook="DefaultEditorWorkbook">
+<info part="DefaultEditorWorkbook">
+<folder appearance="1" expanded="2">
+<presentation id="org.eclipse.ui.presentations.WorkbenchPresentationFactory">
+<part id="0"/>
+</presentation>
+</folder>
+</info>
+</editorArea>
+<editor activePart="true" focus="true" id="org.cloudsmith.geppetto.pp.dsl.PP" name="server.pp" partName="server.pp" title="server.pp" tooltip="/Users/codydracars/vagrant-boxes/debian-6.0.4/modules/nagios/manifests/server.pp" workbook="DefaultEditorWorkbook">
+<input factoryID="org.eclipse.ui.ide.FileStoreEditorInputFactory" uri="file:/Users/codydracars/vagrant-boxes/debian-6.0.4/modules/nagios/manifests/server.pp"/>
+</editor>
+</editors>
+<views>
+<view id="org.eclipse.ui.navigator.ProjectExplorer" partName="Project Explorer">
+<viewState CommonNavigator.LINKING_ENABLED="0" org.eclipse.ui.navigator.resources.workingSets.showTopLevelWorkingSets="0"/>
+</view>
+<view id="org.eclipse.ui.views.ContentOutline" partName="Outline">
+<viewState/>
+</view>
+</views>
+<perspectives activePart="org.cloudsmith.geppetto.pp.dsl.PP" activePerspective="org.eclipse.ui.resourcePerspective">
+<perspective editorAreaTrimState="1" editorAreaVisible="1" fixed="0" version="0.016">
+<descriptor class="org.eclipse.ui.internal.ide.application.ResourcePerspective" id="org.eclipse.ui.resourcePerspective" label="Resource"/>
+<alwaysOnActionSet id="org.eclipse.egit.ui.navigation"/>
+<alwaysOnActionSet id="org.eclipse.search.searchActionSet"/>
+<alwaysOnActionSet id="org.eclipse.ui.edit.text.actionSet.annotationNavigation"/>
+<alwaysOnActionSet id="org.eclipse.ui.edit.text.actionSet.navigation"/>
+<alwaysOnActionSet id="org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo"/>
+<alwaysOnActionSet id="org.eclipse.ui.actionSet.keyBindings"/>
+<alwaysOnActionSet id="org.eclipse.ui.actionSet.openFiles"/>
+<alwaysOnActionSet id="org.eclipse.ui.NavigateActionSet"/>
+<show_view_action id="org.eclipse.ui.navigator.ProjectExplorer"/>
+<show_view_action id="org.eclipse.ui.views.BookmarkView"/>
+<show_view_action id="org.eclipse.ui.views.ContentOutline"/>
+<show_view_action id="org.eclipse.ui.views.PropertySheet"/>
+<show_view_action id="org.eclipse.ui.views.ProblemView"/>
+<show_view_action id="org.eclipse.ui.views.ProgressView"/>
+<show_view_action id="org.eclipse.ui.views.TaskList"/>
+<show_view_action id="org.eclipse.pde.runtime.LogView"/>
+<new_wizard_action id="org.eclipse.ui.wizards.new.folder"/>
+<new_wizard_action id="org.eclipse.ui.wizards.new.file"/>
+<new_wizard_action id="org.eclipse.ui.editors.wizards.UntitledTextFileWizard"/>
+<perspective_action id="org.eclipse.team.ui.TeamSynchronizingPerspective"/>
+<hide_toolbar_item_id id="org.eclipse.ui.edit.text.toggleShowSelectedElementOnly"/>
+<fastViewBars>
+<fastViewBar fastViewLocation="16384" id="bottomLeft" orientation="512" selectedTabId="org.eclipse.ui.views.ContentOutline" style="1">
+<fastViews>
+<view id="org.eclipse.ui.views.ContentOutline" ratio="0.3"/>
+</fastViews>
+</fastViewBar>
+<fastViewBar fastViewLocation="16384" id="topLeft" orientation="512" selectedTabId="org.eclipse.ui.navigator.ProjectExplorer" style="1">
+<fastViews>
+<view id="org.eclipse.ui.navigator.ProjectExplorer" ratio="0.3"/>
+</fastViews>
+</fastViewBar>
+</fastViewBars>
+<layout>
+<mainWindow>
+<info folder="true" part="topLeft">
+<folder appearance="2" expanded="0">
+<page content="org.eclipse.ui.navigator.ProjectExplorer" label="LabelNotFound"/>
+<page content="org.eclipse.ui.views.BookmarkView" label="LabelNotFound"/>
+<page content="org.eclipse.ui.views.ResourceNavigator" label="LabelNotFound"/>
+<presentation id="org.eclipse.ui.presentations.WorkbenchPresentationFactory"/>
+</folder>
+</info>
+<info folder="true" part="stickyFolderRight" ratio="0.75" ratioLeft="762" ratioRight="254" relationship="2" relative="topLeft">
+<folder appearance="2" expanded="2">
+<page content="org.eclipse.help.ui.HelpView" label="LabelNotFound"/>
+<page content="org.eclipse.ui.internal.introview" label="LabelNotFound"/>
+<page content="org.eclipse.ui.cheatsheets.views.CheatSheetView" label="LabelNotFound"/>
+</folder>
+</info>
+<info part="org.eclipse.ui.editorss" ratio="0.25984251" ratioLeft="264" ratioRight="752" relationship="2" relative="topLeft"/>
+<info folder="true" part="bottomRight" ratio="0.658858" ratioLeft="450" ratioRight="233" relationship="4" relative="org.eclipse.ui.editorss">
+<folder appearance="2" expanded="2">
+<page content="org.eclipse.ui.views.TaskList" label="LabelNotFound"/>
+<presentation id="org.eclipse.ui.presentations.WorkbenchPresentationFactory"/>
+</folder>
+</info>
+<info folder="true" part="bottomLeft" ratio="0.49926794" ratioLeft="341" ratioRight="342" relationship="4" relative="topLeft">
+<folder appearance="2" expanded="0">
+<page content="org.eclipse.ui.views.ContentOutline" label="LabelNotFound"/>
+<presentation id="org.eclipse.ui.presentations.WorkbenchPresentationFactory"/>
+</folder>
+</info>
+</mainWindow>
+</layout>
+</perspective>
+</perspectives>
+<workingSets/>
+<navigationHistory>
+<editors>
+<editor factoryID="org.eclipse.ui.ide.FileStoreEditorInputFactory" id="org.cloudsmith.geppetto.pp.dsl.PP" uri="file:/Users/codydracars/vagrant-boxes/debian-6.0.4/modules/nagios/manifests/server.pp"/>
+<editor factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.cloudsmith.geppetto.pp.dsl.PP" path="/.org_cloudsmith_geppetto_pptp_target/server.pp"/>
+</editors>
+<item historyLabel="server.pp" index="0"/>
+<item historyLabel="server.pp" index="1">
+<position info="not_deleted" x="0" y="0"/>
+</item>
+<item historyLabel="server.pp" index="0"/>
+<item historyLabel="server.pp" index="1">
+<position info="not_deleted" x="0" y="0"/>
+</item>
+<item historyLabel="server.pp" index="1">
+<position/>
+</item>
+<item historyLabel="server.pp" index="1">
+<position/>
+</item>
+<item historyLabel="server.pp" index="1">
+<position/>
+</item>
+<item historyLabel="server.pp" index="1">
+<position/>
+</item>
+<item active="true" historyLabel="server.pp" index="0"/>
+</navigationHistory>
+<input factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/" type="8"/>
+</page>
+<workbenchWindowAdvisor/>
+<actionBarAdvisor/>
+<trimLayout>
+<trimArea IMemento.internal.id="16384">
+<trimItem IMemento.internal.id="topLeft"/>
+<trimItem IMemento.internal.id="bottomLeft"/>
+</trimArea>
+<trimArea IMemento.internal.id="128">
+<trimItem IMemento.internal.id="org.eclipse.ui.internal.WorkbenchWindow.topBar"/>
+</trimArea>
+<trimArea IMemento.internal.id="1024">
+<trimItem IMemento.internal.id="org.eclise.ui.internal.FastViewBar"/>
+<trimItem IMemento.internal.id="org.eclipse.jface.action.StatusLineManager"/>
+<trimItem IMemento.internal.id="org.eclipse.ui.internal.progress.ProgressRegion"/>
+</trimArea>
+</trimLayout>
+</window>
+<mruList>
+<file factoryID="org.eclipse.ui.part.FileEditorInputFactory" id="org.cloudsmith.geppetto.pp.dsl.PP" name="server.pp" tooltip=".org_cloudsmith_geppetto_pptp_target/server.pp">
+<persistable path="/.org_cloudsmith_geppetto_pptp_target/server.pp"/>
+</file>
+<file factoryID="org.eclipse.ui.ide.FileStoreEditorInputFactory" id="org.cloudsmith.geppetto.pp.dsl.PP" name="server.pp" tooltip="/Users/codydracars/vagrant-boxes/debian-6.0.4/modules/nagios/manifests/server.pp">
+<persistable uri="file:/Users/codydracars/vagrant-boxes/debian-6.0.4/modules/nagios/manifests/server.pp"/>
+</file>
+</mruList>
+</workbench>
2,731 manifests/.metadata/.plugins/org.eclipse.xtext.builder/builder.state
2,731 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
78 manifests/server.pp
@@ -0,0 +1,78 @@
+class nagios::server {
+
+include apache
+
+package { [ "nagios3",
+"nagios-images",
+"nagios-nrpe-plugin" ]:
+ensure => installed,
+}
+
+service { "nagios3":
+ensure => running,
+enable => true,
+require => Package["nagios3"],
+}
+
+exec { "nagios-config-check":
+command => "/usr/sbin/nagios3 -v /etc/nagios3/nagios.cfg && /usr/sbin/service nagios3 restart",
+refreshonly => true,
+}
+
+file { "/etc/apache2/sites-available/nagios.conf":
+source => "puppet:///modules/nagios/nagios.conf",
+notify => Service["apache2"],
+require => Package["apache2"],
+}
+
+file { "/etc/apache2/sites-enabled/nagios.conf":
+ensure => symlink,
+target => "/etc/apache2/sites-available/nagios.conf",
+require => Package["apache2"],
+}
+
+file { [ "/etc/nagios3/generic-service_nagios2.cfg",
+"/etc/nagios3/services_nagios2.cfg",
+"/etc/nagios3/hostgroups_nagios2.cfg",
+"/etc/nagios3/extinfo_nagios2.cfg",
+"/etc/nagios3/localhost_nagios2.cfg",
+"/etc/nagios3/contacts_nagios2.cfg",
+"/etc/nagios3/conf.d" ]:
+ensure => absent,
+force => true,
+}
+
+define nagios-config() {
+file { "/etc/nagios3/${name}":
+source => "/tmp/vagrant-puppet/modules-0/nagios/files/${name}",
+require => Package["nagios3"],
+notify => Exec["nagios-config-check"],
+}
+}
+
+#Nagios monitoring serverNagios monitoring serverdeploying, steps
+nagios-config { [ "htpasswd.nagios",
+"nagios.cfg",
+"cgi.cfg",
+"hostgroups.cfg",
+"hosts.cfg",
+"host_templates.cfg",
+"service_templates.cfg",
+"services.cfg",
+"timeperiods.cfg",
+"contacts.cfg",
+"commands.cfg" ]:
+}
+
+file { "/var/lib/nagios3": # see http://bugs.debian.org/cgi- bin/bugreport.cgi?bug=478889
+mode => 751,
+require => Package["nagios3"],
+notify => Service["nagios3"],
+}
+
+file { "/var/lib/nagios3/rw": # see http://bugs.debian.org/ cgi-bin/bugreport.cgi?bug=478889
+mode => 2710,
+require => Package["nagios3"],
+notify => Service["nagios3"],
+}
+}
21 manifests/target.pp
@@ -0,0 +1,21 @@
+class nagios::target {
+package { [ "nagios-nrpe-server",
+"nagios-plugins",
+"nagios-plugins-basic",
+"nagios-plugins-standard" ]:
+ensure => installed,
+}
+
+service { "nagios-nrpe-server":
+enable => true,
+ensure => running,
+pattern => "/usr/sbin/nrpe",
+require => Package["nagios-nrpe-server"],
+}
+
+file { "/etc/nagios/nrpe.cfg":
+source => "puppet:///modules/nagios/nrpe.cfg",
+require => Package["nagios-nrpe-server"],
+notify => Service["nagios-nrpe-server"],
+}
+}

0 comments on commit a3b73fe

Please sign in to comment.