Skip to content

Commit

Permalink
Adding the definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
sbotman committed Aug 12, 2015
1 parent a194be3 commit 94a5e71
Show file tree
Hide file tree
Showing 13 changed files with 429 additions and 0 deletions.
33 changes: 33 additions & 0 deletions definitions/command.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# Author:: Sander Botman <sbotman@schubergphilis.com>
# Cookbook Name : nagios
# Definition : command
#
# Copyright 2015, Sander Botman
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

define :nagios_command do
params[:action] ||= :create
params[:options] ||= {}

if nagios_action_create?(params[:action])
o = Nagios::Command.create(params[:name])
o.import(params[:options])
end

if nagios_action_delete?(params[:action])
Nagios.instance.delete('command', params[:name])
end
end
33 changes: 33 additions & 0 deletions definitions/contact.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# Author:: Sander Botman <sbotman@schubergphilis.com>
# Cookbook Name : nagios
# Definition : contact
#
# Copyright 2015, Sander Botman
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

define :nagios_contact do
params[:action] ||= :create
params[:options] ||= {}

if nagios_action_create?(params[:action])
o = Nagios::Contact.create(params[:name])
o.import(params[:options])
end

if nagios_action_delete?(params[:action])
Nagios.instance.delete('contact', params[:name])
end
end
33 changes: 33 additions & 0 deletions definitions/contactgroup.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# Author:: Sander Botman <sbotman@schubergphilis.com>
# Cookbook Name : nagios
# Definition : contactgroup
#
# Copyright 2015, Sander Botman
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

define :nagios_contactgroup do
params[:action] ||= :create
params[:options] ||= {}

if nagios_action_create?(params[:action])
o = Nagios::Contactgroup.create(params[:name])
o.import(params[:options])
end

if nagios_action_delete?(params[:action])
Nagios.instance.delete('contactgroup', params[:name])
end
end
33 changes: 33 additions & 0 deletions definitions/host.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# Author:: Sander Botman <sbotman@schubergphilis.com>
# Cookbook Name : nagios
# Definition : host
#
# Copyright 2015, Sander Botman
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

define :nagios_host do
params[:action] ||= :create
params[:options] ||= {}

if nagios_action_create?(params[:action])
o = Nagios::Host.create(params[:name])
o.import(params[:options])
end

if nagios_action_delete?(params[:action])
Nagios.instance.delete('host', params[:name])
end
end
33 changes: 33 additions & 0 deletions definitions/hostdependency.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# Author:: Sander Botman <sbotman@schubergphilis.com>
# Cookbook Name : nagios
# Definition : hostdependency
#
# Copyright 2015, Sander Botman
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

define :nagios_hostdependency do
params[:action] ||= :create
params[:options] ||= {}

if nagios_action_create?(params[:action])
o = Nagios::Hostdependency.create(params[:name])
o.import(params[:options])
end

if nagios_action_delete?(params[:action])
Nagios.instance.delete('hostdependency', params[:name])
end
end
33 changes: 33 additions & 0 deletions definitions/hostescalation.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# Author:: Sander Botman <sbotman@schubergphilis.com>
# Cookbook Name : nagios
# Definition : hostescalation
#
# Copyright 2015, Sander Botman
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

define :nagios_hostescalation do
params[:action] ||= :create
params[:options] ||= {}

if nagios_action_create?(params[:action])
o = Nagios::Hostescalation.create(params[:name])
o.import(params[:options])
end

if nagios_action_delete?(params[:action])
Nagios.instance.delete('hostescalation', params[:name])
end
end
33 changes: 33 additions & 0 deletions definitions/hostgroup.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# Author:: Sander Botman <sbotman@schubergphilis.com>
# Cookbook Name : nagios
# Definition : hostgroup
#
# Copyright 2015, Sander Botman
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

define :nagios_hostgroup do
params[:action] ||= :create
params[:options] ||= {}

if nagios_action_create?(params[:action])
o = Nagios::Hostgroup.create(params[:name])
o.import(params[:options])
end

if nagios_action_delete?(params[:action])
Nagios.instance.delete('hostgroup', params[:name])
end
end
33 changes: 33 additions & 0 deletions definitions/resource.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# Author:: Sander Botman <sbotman@schubergphilis.com>
# Cookbook Name : nagios
# Definition : resource
#
# Copyright 2015, Sander Botman
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

define :nagios_resource do
params[:action] ||= :create
params[:options] ||= {}

if nagios_action_create?(params[:action])
o = Nagios::Resource.create(params[:name])
o.import(params[:options])
end

if nagios_action_delete?(params[:action])
Nagios.instance.delete('resource', params[:name])
end
end
33 changes: 33 additions & 0 deletions definitions/service.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# Author:: Sander Botman <sbotman@schubergphilis.com>
# Cookbook Name : nagios
# Definition : service
#
# Copyright 2015, Sander Botman
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

define :nagios_service do
params[:action] ||= :create
params[:options] ||= {}

if nagios_action_create?(params[:action])
o = Nagios::Service.create(params[:name])
o.import(params[:options])
end

if nagios_action_delete?(params[:action])
Nagios.instance.delete('service', params[:name])
end
end
33 changes: 33 additions & 0 deletions definitions/servicedependency.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# Author:: Sander Botman <sbotman@schubergphilis.com>
# Cookbook Name : nagios
# Definition : servicedependency
#
# Copyright 2015, Sander Botman
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

define :nagios_servicedependency do
params[:action] ||= :create
params[:options] ||= {}

if nagios_action_create?(params[:action])
o = Nagios::Servicedependency.create(params[:name])
o.import(params[:options])
end

if nagios_action_delete?(params[:action])
Nagios.instance.delete('servicedependency', params[:name])
end
end
33 changes: 33 additions & 0 deletions definitions/serviceescalation.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# Author:: Sander Botman <sbotman@schubergphilis.com>
# Cookbook Name : nagios
# Definition : serviceescalation
#
# Copyright 2015, Sander Botman
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

define :nagios_serviceescalation do
params[:action] ||= :create
params[:options] ||= {}

if nagios_action_create?(params[:action])
o = Nagios::Serviceescalation.create(params[:name])
o.import(params[:options])
end

if nagios_action_delete?(params[:action])
Nagios.instance.delete('serviceescalation', params[:name])
end
end
Loading

0 comments on commit 94a5e71

Please sign in to comment.