sensu / uchiwa-chef Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
Package no longer exists in debian repo?
Output of
kitchen converge repo-ubuntu-1404
Reading package lists...
[2015-02-20T12:19:35+00:00] INFO: execute[apt-get update] ran successfully
- execute apt-get update -o Dir::Etc::sourcelist='sources.list.d/sensu.list' -o Dir::Etc::sourceparts='-' -o APT::Get::List-Cleanup='0'
[2015-02-20T12:19:35+00:00] INFO: execute[apt-get update] sending run action to execute[apt-cache gencaches] (immediate)
* execute[apt-cache gencaches] action run[2015-02-20T12:19:35+00:00] INFO: Processing execute[apt-cache gencaches] action run (/tmp/kitchen/cache/cookbooks/apt/providers/repository.rb line 151)
Reading package lists...
[2015-02-20T12:19:39+00:00] INFO: execute[apt-cache gencaches] ran successfully
- execute apt-cache gencaches
* apt_package[uchiwa] action install[2015-02-20T12:19:39+00:00] INFO: Processing apt_package[uchiwa] action install (uchiwa::repo line 56)
================================================================================
Error executing action `install` on resource 'apt_package[uchiwa]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '100'
---- Begin output of apt-get -q -y --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" install uchiwa=0.4.1-1 ----
STDOUT: Reading package lists...
Building dependency tree...
Reading state information...
STDERR: E: Version '0.4.1-1' for 'uchiwa' was not found
---- End output of apt-get -q -y --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" install uchiwa=0.4.1-1 ----
Ran apt-get -q -y --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" install uchiwa=0.4.1-1 returned 100
Resource Declaration:
---------------------
# In /tmp/kitchen/cache/cookbooks/uchiwa/recipes/repo.rb
56: package 'uchiwa' do
57: options package_options
58: version node['uchiwa']['version']
59: end
Compiled Resource:
------------------
# Declared in /tmp/kitchen/cache/cookbooks/uchiwa/recipes/repo.rb:56:in `from_file'
apt_package("uchiwa") do
action :install
retries 0
retry_delay 2
default_guard_interpreter :default
options "--force-yes -o Dpkg::Options::=\"--force-confdef\" -o Dpkg::Options::=\"--force-confnew\""
package_name "uchiwa"
version "0.4.1-1"
timeout 900
declared_type :package
cookbook_name "uchiwa"
recipe_name "repo"
end
[2015-02-20T12:19:40+00:00] INFO: Running queued delayed notifications before re-raising exception
Running handlers:
[2015-02-20T12:19:40+00:00] ERROR: Running exception handlers
Running handlers complete
[2015-02-20T12:19:40+00:00] ERROR: Exception handlers complete
[2015-02-20T12:19:40+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
Chef Client failed. 12 resources updated in 274.401437097 seconds
[2015-02-20T12:19:40+00:00] ERROR: apt_package[uchiwa] (uchiwa::repo line 56) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '100'
---- Begin output of apt-get -q -y --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" install uchiwa=0.4.1-1 ----
STDOUT: Reading package lists...
Building dependency tree...
Reading state information...
STDERR: E: Version '0.4.1-1' for 'uchiwa' was not found
---- End output of apt-get -q -y --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" install uchiwa=0.4.1-1 ----
Ran apt-get -q -y --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confnew" install uchiwa=0.4.1-1 returned 100
[2015-02-20T12:19:41+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
>>>>>> Converge failed on instance <repo-ubuntu-1404>.
>>>>>> Please see .kitchen/logs/repo-ubuntu-1404.log for more details
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: SSH exited (1) for command: [sudo -E chef-client -z --config /tmp/kitchen/client.rb --log_level info --chef-zero-port 8889 --json-attributes /tmp/kitchen/dna.json]
>>>>>> ----------------------
Need support for chef-vault for storing uchiwa credentials.
Currently the cookbook fails on ubuntu 14.04.1, due to the /etc/init.d script coming from the repo has the name uchiwa.dpkg-dist instead of uchiwa. Had to be manually renamed before the cookbook runs successfully.
The cookbook is currently accessing the Sensu repos via HTTP by default. We should update the cookbook to use HTTPS instead.
Packages should be downloaded via HTTPS only.
Packages are downloaded via HTTP
[Version of the cookbook where you are encountering the issue]
2.0.1
[Version of chef-client in your environment]
12.17.44
[Operating system distribution and release version. Cloud provider if running in the cloud]
RHEL
[What you are trying to achieve and you can't?]
change the uchiwa.json location
[If you are filing an issue what are the things we need to do in order to repro your problem? How are you using this cookbook or any resources it includes?]
modify the uchiwa.sensu_homedir attribute
[What are you expecting to happen as the consequence of above reproduction steps?]
file will be used and stored in different directory
[What actually happens after the reproduction steps? Include the error output or a link to a gist if possible.]
file is not updated in service init script
As stated in the title I have an issue where Uchiwa (installed from package) is upgraded to the latest version when apt-get upgrade
is run. This wouldn't be a terrible issue if I wasn't installing a specific version via attributes, also the latest version seems to have some bugs and doesn't allow me to silence alarms.
This cookbook should probably pin the version used by apt. (Im using Ubuntu 14.04 FYI)
I tried starting Uchiwa with the service init script but it fails, running it manually results in the following error:
[email protected]:/etc/sensu# /opt/uchiwa/embedded/bin/node /opt/uchiwa/usr/src/uchiwa/app.js -c /etc/sensu/uchiwa.json
{"name":"uchiwa","hostname":"ip-ip-X.X.X.X","pid":18046,"level":30,"msg":"Uchiwa is now listening on 0.0.0.0:8080","time":"2014-09-26T21:21:02.921Z","src":{"file":"/opt/uchiwa/usr/src/uchiwa/app.js","line":88},"v":0}
/opt/uchiwa/usr/src/uchiwa/lib/sensu.js:351
name: fullClient.name,
^
TypeError: Cannot read property 'name' of null
at Sensu.eventData (/opt/uchiwa/usr/src/uchiwa/lib/sensu.js:351:23)
at /opt/uchiwa/usr/src/uchiwa/lib/sensu.js:382:24
at Array.forEach (native)
at Function._.each._.forEach (/opt/uchiwa/usr/src/uchiwa/node_modules/underscore/underscore.js:79:11)
at Sensu.buildEvents (/opt/uchiwa/usr/src/uchiwa/lib/sensu.js:381:5)
at /opt/uchiwa/usr/src/uchiwa/lib/dc.js:76:18
at IncomingMessage.<anonymous> (/opt/uchiwa/usr/src/uchiwa/lib/rest.js:37:9)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:919:16
at process._tickCallback (node.js:419:13)
Please release the latest release to chef supermarket too...
[Version of the cookbook where you are encountering the issue]
[Version of chef-client in your environment]
[Operating system distribution and release version. Cloud provider if running in the cloud]
[What you are trying to achieve and you can't?]
[If you are filing an issue what are the things we need to do in order to repro your problem? How are you using this cookbook or any resources it includes?]
[What are you expecting to happen as the consequence of above reproduction steps?]
[What actually happens after the reproduction steps? Include the error output or a link to a gist if possible.]
1.4.0
version 13.7.16
Ubuntu 16.04.3
The /etc/sensu/uchiwa.json file being generated by chef-client when executing this recipe has an empty 'sensu' section. It seemst that the ['uchiwa']['api'] settings are not getting parsed by the default recipe.
The cookbook is being run with default settings with the exception of these three changed attributes:
default['uchiwa']['version'] = '1.1.3-2'
default['uchiwa']['settings']['user'] = 'myuserchoice'
default['uchiwa']['settings']['pass'] = 'mypasswordchoice'
The "API Setting's" section in the attributes file has been left untouched.
The dashboard should be populated.
The dashboard is empty. If I manually enter the values for the sensu section in the uchiwa.json file and restart the service the dashboard populates, but the next chef run blows away the sensu settings from the json file.
This is what the uchiwa.json file looks like after chef runs:
linuxadmin@sensu01:~$ sudo cat /etc/sensu/uchiwa.json
{
"uchiwa": {
"user": "myadmin",
"pass": "mypass",
"refresh": 5,
"host": "0.0.0.0",
"port": 3000
},
"sensu": [
]
}
The datacenter name now always appears as 'Sensu'. It would be really nice to be able to override this with an attribute. We run Uchiwa in a couple of different locations.
The repo recipe still tries to include_recipe 'apt'
. I suspect this got missed during #65? I can send you a tiny PR if you like!
A new attribute users is available which allow to define multiple users on the configuration file: http://docs.uchiwa.io/en/latest/configuration/uchiwa/#multiple-users-with-simple-authentication
Currently uchiwa is restarted every chef run
Please change
default['uchiwa']['apt_repo_url'] = 'http://repos.sensuapp.org/apt'
default['uchiwa']['yum_repo_url'] = 'http://repos.sensuapp.org'
to
default["uchiwa"]["apt_repo_url"] = "http://repositories.sensuapp.org/apt"
default["uchiwa"]["yum_repo_url"] = "http://repositories.sensuapp.org"
http.rb will download and install the package on every chef run. It should only try to install the package if it is not already installed. Probably want to use chef only_if
remote_file "#{Chef::Config[:file_cache_path]}/#{pkg}" do
source url
end
package pkg do
options package_options
source "#{Chef::Config[:file_cache_path]}/#{pkg}"
end
Line 41 in aca9e32
When the repo is going to be configured on Amazon Linux AMI, it fails because the $releasever variable is set as "latest" so the repo URL tries to create as "http://repositories.sensuapp.org/yum/latest/..." and latest doesn't exist. In addition, if you try to lock the AMI to a specific version, $releasever changes to the AMI release date. Eg. "2018.02" and that link also doesn't work.
The default configuration laid down by uchiwa-chef lacks port and path arguments. When uchiwa processes the config file the port and path become undefined. When uchiwa creates REST URLs these variables are interpolated as the string 'undefined' creating bogus URLs like "http://localhost:undefined" or "http://localhost/undefined/stashes".
The default configuration is defined in attributes/default.rb
# APIs Settings
default['uchiwa']['api'] = [
{
'name' => 'Sensu',
'host' => '127.0.0.1',
'ssl' => false,
'timeout' => 5000
}
]
Please update uchiwa to the lastet version ( 0.5)
Passwords and sensitive data should not be saved as a node attribute. This is a security issue, I've tried using node.run_state but that won't work. There needs to be an option to use an encrypted data bag (or chef vault), since that is where sensitive data in chef should live.
Hi,
I use an oauth2 proxy in front of uchiwa to identify my users, i don't need a second authentication layer.
My problem is the uchiwa cookbook forces me to use uchiwa authentication. While i could do a recipe who unsets theses attributes that would be a hack.
Perhaps you could remove default['uchiwa']['settings']['user'] = 'admin'
and default['uchiwa']['settings']['pass'] = 'supersecret'
in attributes/default.rb
?
Regards
I have nginx in front of it and I would like to manage my users there.
can the version be bumped so we get the new repository changes?
I updated the value of default['uchiwa']['version'] to 0.14.1-1 and when I re-run chef I see the package is downloaded and stored in /var/chef/cache but it is not upgraded. To upgrade the package I had to manually run dpkg -i on the package. The chef recipe should download the new package and and attempt to install it.
A rubocop fix in default.rb at line 22 (https://github.com/sensu/uchiwa-chef/blob/master/recipes/default.rb#L22) replaced this line:
settings = Hash.new
with an initializer for an Array:
settings = []
This causes the default.rb recipe to fail with a TypeError "can't convert String into Integer"
Right now, the sensu repo is added by the sensu-chef and the uchiwa-chef cookbook. This creates chef warnings and leads to other funny problems.
I would recommend these steps:
nodejs is required in the metadata, but isn't actually used
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.