sous-chefs / nagios Goto Github PK
View Code? Open in Web Editor NEWDevelopment repository for the nagios cookbook
Home Page: https://supermarket.chef.io/cookbooks/nagios
License: Apache License 2.0
Development repository for the nagios cookbook
Home Page: https://supermarket.chef.io/cookbooks/nagios
License: Apache License 2.0
The default recipe references a directory resource. This resource name references the attribute node['nagios']['resource_dir'].
# resource.cfg differs on RPM and tarball based systems
if node['platform_family'] == 'rhel' || node['platform_family'] == 'fedora'
directory node['nagios']['resource_dir'] do
owner 'root'
group node['nagios']['group']
mode '0750'
end
end
However no default attribute value exists on these system.
It appears this issue was introduced with this commit when the attribute was removed: b12467c
This cookbook's current behavior is to populate Nagios hostgroup entries for all roles found in the current environment (or in all environments if node['nagios']['multi_environment_monitoring'] is true). This can make the Nagios web UI unwieldy, especially if one has many unused roles.
This behavior makes the nagios_hostgroups databag a bit redundant, and indeed the cookbook will throw an error if an item in that databag is a role that the cookbook already found by searching the Chef server.
Would it make sense to add a true/false option to control whether the cookbook will search all nodes for potential monitoring by Nagios, e.g. node['nagios']['specify_hostgroups'] ? Setting this option to true would limit the search of nodes to be monitored to only those specified in nagios_hostgroups data bag items.
service apache2 reload
I'm trying to get pagerduty to be the default contact for all alerts. However there does not appear to be functionality to achieve this. Any idea on how to make it work?
In the README, it states: "Setting admin_contactgroup to "true" will add this pagerduty contact to the admin contact group created by this cookbook." This doesn't work.
Hi,
I am trying to install nagios with chef-zero and vagrant.
I have created users data bag
I have created monitoring role
I have two environments
I have multi environment attribute set to true
when I provision my vm with vagrant, It fails at creating hostgroup template with error
comparison of String with nil failed
template("/etc/nagios3/conf.d/hostgroups.cfg") do
params {:variables=>{:hostgroups=>["monitoring", "_default", "production", "staging", "linux", nil], :search_hostgroups=>[], :search_nodes=>{}}, :config_subdir=>true, :source=>"hostgroups.cfg.erb", :name=>"hostgroups"}
.
I am not sure about why its adding extra nil param to hostgroup search.
Please help.
Does not seem to be a way to assign timeperiods to user data bags, but you can to nagios_contacts. But there is no way to assign nagios_contacts to notification groups. In 5.2.0, you got around this by adding a user data bag without an email and a nagios_contacts data bag with a time period. But now it appears that no longer works. Advice please.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.5 LTS
Release: 12.04
Codename: precise
This block in nagios.cfg.erb:
<% if node['nagios']['server']['install_method'] == 'source' ||
(node['platform_family'] == 'debian' && node['platform_version'].to_i >= 7) ||
(node['platform_family'] == 'rhel' && node['platform_version'].to_i >= 6) ||
(node['platform_family'] == 'ubuntu' && node['platform_version'].to_f >= 14.04) -%>
allow_empty_hostgroup_assignment=1
<% end -%>
Is somehow returning true on my package installed nagios 3.2.3 and ubuntu 12.04, which barfs on the unknown variable. Please advise
In the Kitchen tests, default.bats includes this check:
service nagios3 status
…which fails in environments where either the service is not named "nagios3" or there is no "service" command. At least one or two environments currently in the Kitchen setup fail the test because of this.
I think a more robust check is needed. I'm experimenting with using this instead:
ps -C nagios | grep -q nagios
Of course, this still assumes some kind of Linux environment. I'm still a rookie with Kitchen, so I don't know the right way to make tests conditional on the underlying OS.
anyone know how to get passed this? i cant get this to do updates, when i create contacts, it either asks me for the commands in the contact databag or throws the error in the subject.
I want to use node['nagios']['monitoring_interface']
to specify that the NRPE should use this interface to communicate with nodes. However when using vagrant to test this, it was not putting in the ip address of the interface.
The clause && node['network']["ipaddress_#{node['nagios']['monitoring_interface']}"]
on ip_to_monitor
always fails for me. And some results online imply that this is not how you get the ip address of interface X.
However I'm new to chef & ruby, so I might have made something wrong.
def check_period(period)
# should be HH:MM-HH:MM ([01]?[0-9]|2[0-3])\:[0-5][0-9]
return period if period =~ /^([01]?[0-9]|2[0-3])\:[0-5][0-9]-([01]?[0-9]|2[0-4])\:[0-5][0-9]$/
nil
end
Needs to allow for multiple time ranges
ex: '00:00-06:00,17:00-19:00' or '00:00-04:00,12:00-14:00,16:00-24:00'
On Ubuntu 12.04, the nagios-plugins* packages already include checks with these names:
% grep check-host-alive *
ping.cfg:# 'check-host-alive' command definition
ping.cfg: command_name check-host-alive
ping.cfg:# 'check-host-alive_4' command definition
ping.cfg: command_name check-host-alive_4
% grep check_nrpe *
check_nrpe.cfg: command_name check_nrpe
check_nrpe.cfg: command_line /usr/lib/nagios/plugins/check_nrpe -H
check_nrpe.cfg: command_name check_nrpe_1arg
check_nrpe.cfg: command_line /usr/lib/nagios/plugins/check_nrpe -H
This causes Nagios not to startup due to duplicate command definitions.
Am I missing something obvious, or does this line prevent defining a service whose hostgroup_name is "all"?
https://github.com/tas50/nagios/blob/master/templates/default/services.cfg.erb#L8
And if so, does that mean that this example (from the README) needs to be changed?
{
"id": "pingme",
"hostgroup_name": "all",
"use_existing_command": "check-host-alive"
}
Processing object config file '/etc/nagios3/conf.d/commands.cfg'...
Processing object config file '/etc/nagios3/conf.d/hostgroups.cfg'...
Processing object config file '/etc/nagios3/conf.d/hosts.cfg'...
Processing object config file '/etc/nagios3/conf.d/timeperiods.cfg'...
Processing object config file '/etc/nagios3/conf.d/servicegroups.cfg'...
Error: Could not find any hostgroup matching 'linux' (config file '/etc/nagios3/conf.d/hosts.cfg', starting on line 5)
Error processing object config files!
***> One or more problems was encountered while processing the config files...
Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.
* errors in config!
...fail!
STDERR:
---- End output of /etc/init.d/nagios3 reload ----
Ran /etc/init.d/nagios3 reload returned 6
The version of the nagios cookbook in the 5.3.4
tag is not the same as the 5.3.4
version on the community (supermarket) site.
The metadata file puts the version at 5.3.5
and the work to move NRPE functionality to another cookbook is committed.
I thought this was affecting the community cookbook but it's actually not so it's not a huge problem for us, but it is confusing...
Fix applied in #332
The apache config contains this:
Alias /stylesheets /etc/nagios3/stylesheets
Alias /nagios3/stylesheets /etc/nagios3/stylesheets
But /etc/nagios3/stylesheets doesn't exist, so the web interface is un-styled.
Hi - I am trying to use a custom host template (defined in the host_templates databag) when adding a special type of VM to Nagios following your instructions here: https://github.com/tas50/nagios/wiki/host_templates
"You then use the host template by setting the node['nagios']['host_template'] attribute for a node. You could apply this with a role as follows:
role 'windows'
default_attributes(
nagios: {
host_template: 'windows-host'
}
)".
I see that the host definition is being updated in /etc/nagios/conf.d/templates.cfg, however, when I set the node['nagios']['host_template'] attribute in my special type of VM, Nagios does not use the right host template (the one set in the node attribute), but instead it uses the default one "server".
Gustavo
$ berks upload nagios
E, [2014-10-22T16:32:36.399822 #5892] ERROR -- : Ridley::Errors::HTTPBadRequest: {"error":["Invalid element in array value of 'templates'."]}
$ find ~/.berkshelf/cookbooks/* -name '.DS_Store' -type f | xargs -n1 -p rm
rm /home/jpotkanski/.berkshelf/cookbooks/nagios-6.0.0/.DS_Store ?...y
rm /home/jpotkanski/.berkshelf/cookbooks/nagios-6.0.0/templates/.DS_Store ?...y
rm /home/jpotkanski/.berkshelf/cookbooks/nagios-6.0.0/templates/default/.DS_Store ?...y
https://github.com/tas50/nagios/blob/master/templates/default/apache2.conf.erb#L18-L19
Stylesheets are in /usr/share/nagios/html, not /etc/nagios - so this template produces a broken nagios homepage by default
(I'm not sure if this is just poorly chosen default directories or not?)
Exhibit A: /var/log/nagios mode 755 https://github.com/tas50/nagios/blob/master/recipes/server_source.rb#L113
Exhibit B: /var/log/nagios mode 751
https://github.com/tas50/nagios/blob/master/recipes/default.rb#L208
This can be avoided in the current recipe code if the default state_dir is changed.
Same problem for conf_dir but this involves the nrpe::_source_nrpe recipe, so I'll tackle that later.
roles will be empty, but a double comma will get templated out instead:
define host {
use server
address 10.0.2.15
host_name server-ubuntu-1204
hostgroups all,linux,,
}
It's i simple bug, the default['nagios']['conf_dir'] points to /etc/nagios3 on ubuntu and /etc/nagios on centos. However the apache/nginx app templates for vhost defines path to (for example stylesheets) as node['nagios']['server']['vname'] which in all cases (platform_family) is "nagios3".
I think you should use " default['nagios']['conf_dir']" attribute in the templates. And update attributes to create path for conf_dir as etc+vname.
Files afffected - see:
https://github.com/tas50/nagios/search?q=stylesheets&ref=cmdform
I am running into an interesting feature..
Scenario:
Generating a servicegroups.cfg via (example) nagios_servicegroups/custom_servicegroup.json databag file:
{
"id": "SS",
"alias": "Some Alias",
"notes": "SomeService Note"
}
and using the following (example) nagios_services/custom_service.json databag:
{
"id": "SSMaster",
"hostgroup_name": "SSMaster_list",
"command_line": "$USER1$/check_something...",
"servicegroups": "SS"
}
It would seem that when members are added to the servicegroups.cfg file, only the service description name (ex. ssmaster), is being added to the list and not ANY hosts (servicegroups.cfg):
line 7: define servicegroup {
line 8: servicegroup_name SS
line 9: members ssmaster
line 10: }
This breaks the nagios config check (nagios -v /etc/nagios/nagios.cfg) seemingly with output like this:
Nagios Core 3.5.1
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
...
...
Error: Could not find a service matching host name 'ssmaster' and description 'nodeX' (config file '/etc/nagios/conf.d/servicegroups.cfg', starting on line 9)
Error: Could not expand member services specified in servicegroup (config file '/etc/nagios/conf.d/servicegroups.cfg', starting on line 9)
Error processing object config files!
The 'nodeX' becomes other services if they are added to the services databag with the "servicegroups": "SS"
line.
Is my method to deploy servicegroups wrong here? Am I missing something that could allow a better or no member list to be generated? If I comment out the members line in the servicegroups.cfg file, things seem to work properly...oddly enough because of the servicegroups SS
line in the services.cfg file.
Any thoughts on this issue? Bottom line, members in the servicegroups.cfg file are only being populated with services and not hosts except in the case of a single service, then it grabs a seemingly random host and populates in wrong order (service,host or service,service.. instead of host,service,host,service...)
Also the validation could be changed to:
valid = !!service['hostgroup_name'].split(",").
find { |s| @hostgroups.include?(s) or @search_hostgroups.include?(s) }
Generated apache:
<VirtualHost *:80>
ServerAdmin root@localhost
ServerName mvfdev2eae2e18.local
DocumentRoot /usr/share/nagios3/htdocs
CustomLog /var/log/apache2/nagios_access.log combined
ErrorLog /var/log/apache2/nagios_error.log
Alias /stylesheets /etc/nagios3/stylesheets
ScriptAlias /cgi-bin/nagios3 /usr/lib/cgi-bin/nagios3
Alias /nagios3 /usr/share/nagios3/htdocs
<Directory "/usr/lib/cgi-bin/nagios3">
Options ExecCGI
SetEnv TZ "UTC"
Should be:
<VirtualHost *:80>
ServerAdmin root@localhost
ServerName mvfdev2eae2e18.local
DocumentRoot /usr/share/nagios3/htdocs
CustomLog /var/log/apache2/nagios_access.log combined
ErrorLog /var/log/apache2/nagios_error.log
Alias /stylesheets /etc/nagios3/stylesheets
Alias /nagios3/stylesheets /etc/nagios3/stylesheets
ScriptAlias /cgi-bin/nagios3 /usr/lib/cgi-bin/nagios3
Alias /nagios3 /usr/share/nagios3/htdocs
<Directory "/usr/lib/cgi-bin/nagios3">
Options ExecCGI
SetEnv TZ "UTC"
...or perhaps there is a better way to fix this but I don't have time to fix atm.
Now that the server doesn't check itself there can exist a condition where no services are defined and the service will fail to start. It might make sense to define a bogus service is the service array is empty.
v4.3.4 doesn't create /etc/nagios3/conf.d so the chef run fails.
Manually creating that directory and setting it off again works.
Looks like this PR causes nagios to error out on startup if no unmanaged hosts invoke the new service-template service.
#293
Things worked fine with the cookbook tagged 5.3.4, but switching to master (v5.3.5) broke nagios as shown below.
root@my-server:/etc/nagios/conf.d# service nagios restart
Running configuration check...
Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2014
License: GPL
Website: http://www.nagios.org
Reading configuration data...
Warning: use_embedded_perl_implicitly is deprecated and will be removed.
Warning: enable_embedded_perl is deprecated and will be removed.
Warning: sleep_time is deprecated and will be removed.
Warning: external_command_buffer_slots is deprecated and will be removed. All commands are always processed upon arrival
Warning: command_check_interval is deprecated and will be removed. Commands are always handled on arrival
Read main config file okay...
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in host type objects (config file '/etc/nagios/conf.d/templates.cfg', starting at line 29)
Warning: failure_prediction_enabled is obsoleted and no longer has any effect in service type objects (config file '/etc/nagios/conf.d/templates.cfg', starting at line 56)
Error: Service has no hosts and/or service_description (config file '/etc/nagios/conf.d/templates.cfg', starting on line 97)
Error processing object config files!
Below is my /etc/nagios/conf.d/templates.cfg. Line 97 is the last service definition. Also, isn't the "service-template" definition redundant with the "default-service" definition anyway?
# Template definitions
#
# Autogenerated by Chef.
define contact {
name default-contact
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r,f,s
host_notification_options d,u,r,f,s
# service_notification_commands service-notify-by-email, service-notify-by-jabber
service_notification_commands service-notify-by-email
# host_notification_commands host-notify-by-email, host-notify-by-sms-gateway, host-notify-by-jabber
host_notification_commands host-notify-by-email
register 0
}
define contact {
name sms-contact
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r,f,s
host_notification_options d,u,r,f,s
service_notification_commands service-notify-by-sms-gateway
host_notification_commands host-notify-by-sms-gateway
register 0
}
define host {
name default-host
notifications_enabled 1
event_handler_enabled 1
flap_detection_enabled 1
failure_prediction_enabled 1
process_perf_data 0
retain_status_information 1
retain_nonstatus_information 1
notification_period 24x7
register 0
}
define host {
name server
use default-host
check_period 24x7
check_interval 120.0
retry_interval 15.0
max_check_attempts 1
check_command check-host-alive
notification_interval 1800.0
notification_options d,u,r
contact_groups admins
register 0
}
define service {
name default-service
active_checks_enabled 1
passive_checks_enabled 1
parallelize_check 1
obsess_over_service 1
check_freshness 0
notifications_enabled 1
event_handler_enabled 1
flap_detection_enabled 1
failure_prediction_enabled 1
process_perf_data 0
retain_status_information 1
retain_nonstatus_information 1
is_volatile 0
check_period 24x7
max_check_attempts 3
check_interval 120.0
retry_interval 15.0
contact_groups admins
notification_options w,u,c,r
notification_interval 1800.0
notification_period 24x7
register 0
}
# Define the log monitoring template (monitoring logs is very different)
define service{
name default-logfile
use default-service
check_period 24x7
max_check_attempts 1
check_interval 120.0
retry_interval 15.0
contact_groups admins
notification_options w,u,c,r
notification_period 24x7
register 0
is_volatile 1
}
define service{
name service-template
max_check_attempts 3
check_interval 120.0
retry_interval 15.0
notification_interval 1800.0
}
# Host templates defined by data bags
Tim,
Could you enable wiki on the repo so we can start write some documentation and make the readme shorter.
Thx.
This is possibly a a patch to submit, but using a base nagios::server runlist on a server that had previously had a pretty base lemp stack runlist run on it.
I had to add an additional location{} block to the vhost generated in order to parse php.
After this was done only then was I able to access the nagios v shell via the browser. Before that I was being served un parsed php files to download.
I am prposing to ad an , if node.fpm_group that the below block be added.
Alternativly I have configured something wrong and could use a pointer at debugging.
After I modify the vhost I am able to click around for a bit before getting time outs.
When I look at top I have several processes owned by perl-fcgi that are taking up high amounts of the cpu's resources.
"default_attributes": {
"nagios": {
"server_role": "monitoring",
"server_auth_method": "htauth",
"server": {
"web_server": "nginx"
}
}
},
"override_attributes": {
"nagios": {
"server": {
}
}
},
"chef_type": "role",
"run_list": [
"recipe[nagios::server]"
],
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
A restart of nrpe is executed during every chef run.
Anyway to change this so that nrpe is only restarted if something changed or add an option to prevent a restart during every run?
service node['nagios']['nrpe']['service_name'] do
action [:start, :enable]
supports :restart => true, :status => false
end
I have a simple wrapper cookbook that pulls in the default recipe and passes in attribute. I was previously using v5.3.5 on the master branch before this mornings pushes and now I'm using v6.0.0 from the Chef supermarket API.
My kitchen tests are failing because the cookbook is adding an incorrect hostgroup.
define host {
use server
address 10.0.2.15
host_name server-ubuntu-1204.vagrantup.com
hostgroups _default,all,linux,monitoring
}
Where is that _default coming from?
Steps:
Result:
404 Error
Expected:
Nagios console to display (prompt for authentication)
Note: The call to enable the nagios3 virualhost seems to fail with odd file name: "nagois3.conf.conf"
I'm using Apache 2 community cookbook version 2.0.0
add code:
web_srv = node['nagios']['server']['web_server']
Not Found
The requested URL /nagios/cgi-bin//status.cgi was not found on this server.
Apache Server at localhost Port 8087
When we use to multi_environment feauture, we can use environment_list for just what we want to see on nagios. Or environment_exception_list for what we dont want to.
There is small bug in the server.rb or default.rb recipe. The 'web_serv' is not configured. You want to assing it value of node['nagios']['server']['web_server'] or use this attribute instead.
case node['nagios']['server_auth_method']
when 'openid'
if web_srv == 'apache'
If I propose to change last line in next code copy/paste from libraries.
UseCase:
I have node (that unlikly to other hosts has primary interface eth1 instead eth0. I was about to set node properties to node['nagios']['monitoring_interface']
on given node however the original def ip_to_monitor uses the monitoring server value for this attribute while calculating the node IP to be monitored.
The proposed change, (last two lines) From:
# decide whether to use internal or external IP addresses for this node
# if the nagios server is not in the cloud, always use public IP addresses for cloud nodes.
# if the nagios server is in the cloud, use private IP addresses for any
# cloud servers in the same cloud, public IPs for servers in other clouds
# (where other is defined by node['cloud']['provider'])
# if the cloud IP is nil then use the standard IP address attribute. This is a work around
# for OHAI incorrectly identifying systems on Cisco hardware as being in Rackspace
def ip_to_monitor(monitored_host, server_host = node)
# if interface to monitor is specified implicitly use that
if node['nagios']['monitoring_interface'] && node['network']["ipaddress_#{node['nagios']['monitoring_interface']}"]
node['network']["ipaddress_#{node['nagios']['monitoring_interface']}"]
# if server is not in the cloud and the monitored host is
elsif server_host['cloud'].nil? && monitored_host['cloud']
monitored_host['cloud']['public_ipv4'].include?('.') ? monitored_host['cloud']['public_ipv4'] : monitored_host['ipaddress']
# if server host is in the cloud and the monitored node is as well, but they are not on the same provider
elsif server_host['cloud'] && monitored_host['cloud'] && monitored_host['cloud']['provider'] != server_host['cloud']['provider']
monitored_host['cloud']['public_ipv4'].include?('.') ? monitored_host['cloud']['public_ipv4'] : monitored_host['ipaddress']
else
monitored_host['ipaddress']
end
end
To:
(use monitored_host
instead of node
- this should even fit's need of the monitoring server in case this behavior was not the original intention).
def ip_to_monitor(monitored_host, server_host = node)
# if interface to monitor is specified implicitly use that
if monitored_host['nagios']['monitoring_interface'] && monitored_host['network']["ipaddress_#{monitored_host['nagios']['monitoring_interface']}"]
monitored_host['network']["ipaddress_#{monitored_host['nagios']['monitoring_interface']}"]
...
...
Chef run fails on nagios node puts pagerduty.key = null in the node.
Tried making it a number or string, as well as deleting it entirely and it would always come back as null.
Workaround is to have a fake value for both pagerduty.key and pagerduty_key:
"nagios": {
"pagerduty_key": "999",
"pagerduty": {
"key": "888"
},
After chef run completed successfully the node shows
"nagios": {
"pagerduty_key": "888",
"pagerduty": {
"key": "888"
},
/etc/nagios3/conf/pagerduty.cfg has a contact of 888 as well as my data bag one.
Please make that section in the node not required if using a data bag.
I seem to still be having an issue bringing in my service group stuff.. Can anyone verify this isn't still an issue from the providers angle? Thank you for your time. See output below, should be using the latest version since Merge #350. If I am possibly missing something that should fix this I am happy to try things.
* nagios_resourcelist_items[update] action update[2015-03-27T20:55:51+00:00] INFO: Processing nagios_resourcelist_items[update] action update (nagios::default line 169)
==============================================================================
Error executing action `update` on resource 'nagios_resourcelist_items[update]'
==============================================================================
NoMethodError
-------------
undefined method `create' for Nagios::Servicegroup:Class
Cookbook Trace:
---------------
/tmp/kitchen/cache/cookbooks/nagios/providers/resourcelist_items.rb:60:in `update_object'
/tmp/kitchen/cache/cookbooks/nagios/providers/resourcelist_items.rb:46:in `block (2 levels) in class_from_file'
/tmp/kitchen/cache/cookbooks/nagios/providers/resourcelist_items.rb:21:in `block in class_from_file'
Resource Declaration:
---------------------
# In /tmp/kitchen/cache/cookbooks/nagios/recipes/default.rb
169: nagios_resourcelist_items 'update'
170:
Compiled Resource:
------------------
# Declared in /tmp/kitchen/cache/cookbooks/nagios/recipes/default.rb:169:in `from_file'
nagios_resourcelist_items("update") do
action :update
retries 0
retry_delay 2
default_guard_interpreter :default
declared_type :nagios_resourcelist_items
cookbook_name "nagios"
recipe_name "default"
end
[2015-03-27T20:55:51+00:00] INFO: Running queued delayed notifications before re-raising exception
[2015-03-27T20:55:51+00:00] INFO: template[/etc/nagios/nagios.cfg] sending reload action to service[nagios] (delayed)
* service[nagios] action reload[2015-03-27T20:55:51+00:00] INFO: Processing service[nagios] action reload (nagios::default line 197)
[2015-03-27T20:55:51+00:00] INFO: service[nagios] reloaded
- reload service service[nagios]
Running handlers:
[2015-03-27T20:55:51+00:00] ERROR: Running exception handlers
Running handlers complete
[2015-03-27T20:55:51+00:00] ERROR: Exception handlers complete
[2015-03-27T20:55:51+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
Chef Client failed. 3 resources updated in 51.925204806 seconds
[2015-03-27T20:55:51+00:00] ERROR: nagios_resourcelist_items[update] (nagios::default line 169) had an error: NoMethodError: undefined method `create' for Nagios::Servicegroup:Class
[2015-03-27T20:55:52+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
It seems Apache2 (at least) triggers a non-OK exit code when the document root for a vhost doesn't exist (see below). Apache2/nginx have a dependency on nagios being installed but not vice versa, so why not just install nagios::server_* before the web server?
Running handlers:
[2014-06-28T20:27:37+00:00] ERROR: Running exception handlers
Running handlers complete
[2014-06-28T20:27:37+00:00] ERROR: Exception handlers complete
[2014-06-28T20:27:37+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 4 resources updated in 10.48862277 seconds
[2014-06-28T20:27:37+00:00] ERROR: service[apache2](apache2::default line 188) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /etc/init.d/apache2 start ----
STDOUT: * Starting web server apache2
Action 'start' failed.
The Apache error log may have more information.
...fail!
STDERR: Warning: DocumentRoot [/usr/share/nagios3/htdocs] does not exist
[Sat Jun 28 20:27:37 2014] [warn] NameVirtualHost *:80 has no VirtualHosts
---- End output of /etc/init.d/apache2 start ----
Ran /etc/init.d/apache2 start returned 1
[2014-06-28T20:27:37+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
There's an attribute to change the dir, but the recipe doesn't create the dir. This should be created by the recipe
On file recipes/default.rb, line 119:
if all_nodes.key?('tags') && all_nodes['tags'].include?(exclusion_tag)
If all_nodes is a Hash with a key pointing to a nil value (default config on opscode when no tag is set), then the cookbook breaks.
It should check:
if all_nodes.key?('tags') && not all_nodes['tags'].nil? && all_nodes['tags'].include?(exclusion_tag)
Cheers,
Is there plan or ongoing work for install and configure Nagios 4.x ?
/stylesheets/common.css is not being loaded with package installed on Precise
/etc/nagios3/resource.cfg is not created, so checks fail.
I downloaded and installed the dependencies listed on the README, but when I attempted to compile the cookbooks on the Nagios Server, it failed due to additional cookbook dependencies listed in the chef-client log during convergence.
Below are a list of the additional cookbook dependencies that I had to download in order to get the chef-client to run recipe[nagios::default].
== Additional Cookbook dependencies ==
apt
bluepill
chef-sugar
iis
smf
mysql
ohai
perl
rbac
rsyslog
runit
smf
xml
yum
yum-mysql-community
When a servicegroup data bag item is defined the cookbook will fail when trying to call Servicegroup.create, it is not defined.
================================================================================
Error executing action `update` on resource 'nagios_resourcelist_items[update]'
================================================================================
NoMethodError
-------------
undefined method `create' for Nagios::Servicegroup:Class
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/nagios/providers/resourcelist_items.rb:60:in `update_object'
/var/chef/cache/cookbooks/nagios/providers/resourcelist_items.rb:46:in `block (2 levels) in class_from_file'
/var/chef/cache/cookbooks/nagios/providers/resourcelist_items.rb:21:in `block in class_from_file'
Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/nagios/recipes/default.rb
169: nagios_resourcelist_items 'update'
170:
Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/nagios/recipes/default.rb:169:in `from_file'
nagios_resourcelist_items("update") do
action :update
retries 0
retry_delay 2
cookbook_name "nagios"
recipe_name "default"
end
Ubuntu 12.04 - nagios3-3.2.3-3ubuntu1
Ubuntu 14.04 - nagios3-3.5.1-1ubuntu1
It appears the packages contain default configs located in /etc/nagios3/conf.d with the suffix _nagios2.cfg. These config files contain definitions for the root contact and others, which causes Nagios to fail to start. Removing *_nagios2.cfg seems to fix the issue.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.