Giter Site home page Giter Site logo

puppetexplorer's Introduction

Puppet Explorer - Never sailed straighter

Overview

Puppet Explorer is a web application for PuppetDB that lets you explore your Puppet data. It is made using AngularJS and runs entirely on the client side, so the only backend that is needed is PuppetDB itself and a web server to share the static resources.

It has the same query language as the popular Puppet module dalen-puppetdbquery. This lets you easily filter for a selection of nodes and show the events or facts for only them. So you can handle hosts as groups without needing to have predefined groups, just make them up as you need and click on the pie charts to drill down further. The JavaScript version of this query parser is available as a separate component so you can use it in your own projects easily, node-puppetdbquery.

All views in the application are made to be able to link directly to them, so it is easy to share information you find with coworkers.

It has support for multiple PuppetDB servers.

Screenshots

The dashboard:

The dashboard

Node search:

Node search

Events view and filtering:

Events view

Facts view:

Facts view

Demo

Try it out live with some made up AWS data at demo.puppetexplorer.io

Installation

The recommended way to install it is on the same host as your PuppetDB instance. Then proxy /api to port 8080 of your PuppetDB instance (except the /commands endpoint). This avoids the need for any CORS headers.

It is possible to have it on a separate domain from your PuppetDB though. If you do, make sure you have the correct Access-Control-Allow-Origin header and a Access-Control-Expose-Headers: X-Records header.

You need to copy config.js.example to config.js and modify it for your needs.

To simplify installation you can use the spotify-puppetexplorer Puppet module.

Dependencies

It is using the V4 PuppetDB API from PuppetDB 3.2. Version 1.5.0 works with PuppetDB 2.3.x, but the current version only works with PuppetDB 3.x.

Versions of Puppet prior to 4.0, converted Facter's facts to string, limiting the puppetexplorer's ability to compare them. The stringifyfacts Puppet parameter permits to disable this old behaviour. Please note that Facter 2.3.0 or newer is required for this setting to take effect.

Development and local testing

Install all required dependencies using npm install and the grunt cli tool globally using npm install -g grunt-cli. Then you can build the application using grunt. The results will be located in the dist directory.

Use grunt serve to start a local web server pointing to the demo site PuppetDB instance.

Optionally you can use the --puppetdb=url option to specify a URL to proxy PuppetDB connections to. Another way is to create a SSH tunnel to your PuppetDB server, ssh -L 8080:localhost:8080 puppetdb.example.com and grunt serve --puppetdb=http://localhost:8080/.

With grunt dev it will start a development server rebuild any source files that changes and put the results in the dist directory.

To build a Debian package use grunt build_debian, this requires the devscripts and debhelper packages to be installed.

To build a RPM use grunt build rpm:snapshot, this requires the rpm-build package to be installed. The resulting RPM will be in rpm/RPMS/noarch.

See also

puppetexplorer's People

Contributors

dalen avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar jasonhancock avatar jiuka avatar kirillk77 avatar kklin avatar smortex avatar timl avatar visibilityspots avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

puppetexplorer's Issues

Null field queries are converted into generic string queries

  • Sometimes a node won't have the report-timestamp field set yet (same can be applied to other fields).

I haven't been able to figure out how to directly search for a field that is null.

If I do the following search:

#node.report-timestamp = null

The following query is ran:

/v4/nodes?include-total=true&limit=50&offset=0&order-by=%5B%7B%22field%22:%22certname%22,%22order%22:%22asc%22%7D%5D&query=%5B%22in%22,%22certname%22,%5B%22extract%22,%22certname%22,%5B%22select-nodes%22,%5B%22%3D%22,%22report-timestamp%22,%22null%22%5D%5D%5D%5D

This has "null" wrapped in quotes: %22null%22

However, if you remove the quotes and manually execute the query, you will get a JSON object with results as expected.

/v4/nodes?include-total=true&limit=50&offset=0&order-by=%5B%7B%22field%22:%22certname%22,%22order%22:%22asc%22%7D%5D&query=%5B%22in%22,%22certname%22,%5B%22extract%22,%22certname%22,%5B%22select-nodes%22,%5B%22%3D%22,%22report-timestamp%22,null%5D%5D%5D%5D

This seems to indicate that null fields aren't supported. Or that it's not obvious.

Latest puppetexplorer broke compatibility with PuppetDB < 3.0.0

After upgrading a working system to the latest puppetexplorer it refused to work anymore.

At first there was a trivial change to our proxy for PuppetDB (/api/v4 became /api/pdb/query/v4). We quickly fixed it, but please do note that it doesn't appear to be fixed in spotify-puppetexplorer module.

Then we're stuck with "Unsupported query parameter 'order_by'". It seems that PuppetDB 3.0 changed it from the older "order-by" to the newer "order_by": http://docs.puppetlabs.com/puppetdb/3.0/api/query/v4/upgrading-from-v3.html

It would be cool if Puppetexplorer could retain compatibility with PuppetDB < 3.0 (maybe via a configuration parameter?), but if it couldn't it should be noted in the Dependencies section of README.md.

Icon explainations

When I hoover my mouse over the icon for a node report I expect to see an explaination.
New users don't know the difference between a grey-checked-icon, green-checked-icon or blue-checked-icon, etc.

Please add some onmouseover descriptions.

Number format.

At work we use the Dutch number format on Windows PC's.
Numbers on the dashboard page are formatted this way;
Nodes: 369,00
Resources: 150.2
Avg resources/node: 407,24
Resource duplication %: 96,82

instead of the correct presentation with English number format;
Nodes: 369
Resources: 150,271
Avg resources/node: 407.2
Resource duplication %: 96.8

Is this fixable without switching to English number format in Windows?

Problems with latest version and puppetdb 3.0

Hi,

I'm trying to get the latest git version of puppetexplorer working with puppetdb3.0.

I'm proxy all request to puppetdb via apache, as recommended in the README. My proxypass config looks like this:

ProxyPass /api http://localhost:8080/
ProxyPassReverse /api http://localhost:8080/

and config.js:

PUPPETDB_SERVERS = [
['production', '/api'],
];

When trying to access Puppetexplorer via http i get the following error:

The requested URL /pdb/dashboard/index.html was not found on this server.

It looks like it's trying to pull index.html via the puppetdb api?
I'm not getting any info from puppetdb in the dashboard either.

Trying to access /api with curl gives me a 302:
curl -X GET http://localhost/api/pdb/meta/v1/version
::1 - - [20/Aug/2015:08:45:54 +0200] "GET /api/pdb/meta/v1/version HTTP/1.1" 302 - "-" "curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2"

Any ideas what I'm doing wrong?

Regards,
Alexander

Sort node columns

If it is a simple task to do, please add the functionality to click on the column titles (in the Nodes tab) to sort the data.
(you might want to add a title (like "Status") to the icon column so there's a title to click)

Population metric names changed in PuppetDB 4.x

Population metric names changed in PuppetDB 4.x

https://docs.puppetlabs.com/puppetdb/4.0/api/metrics/v1/changes-from-puppetdb-v3.html#population-metrics

For example, the following metrics:

puppetlabs.puppetdb.query.population:type=default,name=num-nodes
puppetlabs.puppetdb.query.population:type=default,name=num-resources
puppetlabs.puppetdb.query.population:type=default,name=avg-resources-per-node
puppetlabs.puppetdb.query.population:type=default,name=pct-resource-dupes

are now, respectively:

puppetlabs.puppetdb.population:name=num-nodes
puppetlabs.puppetdb.population:name=num-resources
puppetlabs.puppetdb.population:name=avg-resources-per-node
puppetlabs.puppetdb.population:name=pct-resource-dupes

As I'm proxying puppetexplorer with Apache, the addition of a rewrite rule works around this for now:

RewriteEngine On
RewriteRule ^/api/metrics/v1/mbeans/puppetlabs.puppetdb.query.population:type=default,name=(.*)$  https://%{HTTP_HOST}/api/metrics/v1/mbeans/puppetlabs.puppetdb.population:name=$1 [R=301,L]

standalone mode + configuration management database

Hi,

I was wondering does puppetexplorer tool can help with using it for my puppet environment which runs in standalone mode across machines tied with a web based key/value configuration management database.

thanks.

Events tab shows "No matching events found"

With puppetexplorer 1.3.1 from rpm and puppetdb-2.2.2 we have some issues:

  • Nodes tab doesn't show anything
    nodes
  • Events tab shows "No matching events found" and all charts show "No data"
    events

We used puppet-puppetexplorer to install everything.

Custom Pagination

If you search this project for the string "page=50" you'll find the places where the pagination counter is hardcoded to 50 elements per page.

Could this please become a custom variable in config.js instead?
(I want to list more than 50 nodes per page in the Nodes tab)

Notify if `Last run` was long time ago

I would like to be notified if some of my hosts have not been run puppet for a long time.
Is it possible to add new parameter to config.js, like max-time-lag or max-sync-lag and mark such hosts in UI?

RPM's differ even though its the same release

Hello,

I've been building puppetexplorer after changing a few things and noticed that puppetexplorer stopped working on Firefox but worked flawlessly on Chrome.
So I created an RPM with the unmodified 1.3.1 release and still the same issue where the app did not work via FF but worked on Chrome.

So I installed the RPM package you created and even the one from the gleezy repo and ofcourse the issue was gone. Puppetexplorer worked fine on both firefox and chrome without any issues.

Is this something you are aware of or perhaps something wrong in my build env?
Because I followed the instructions in the README. I also ran both grunt build rpm:snapshot and grunt build rpm:release and tested both versions without avail.

Resources not found

Hello,
I'm using puppetdb 4.1 on Ubuntu 16.04. When I open the dashboard I receive:

GET https://my_ip_address/api/metrics/v1/mbeans/puppetlabs.puppetdb.query.population:type=default,name=pct-resource-dupes 404 (Not Found)

Error: Could not fetch metric pct-resource-dupes from PuppetDB

Here's my 25-localhost ProxyPass section:

ProxyPass /api http://localhost:8080
ProxyPassReverse /api http://localhost:8080

ProxyPass /api/pdb/query http://localhost:8080/pdb/query
ProxyPassReverse /api/pdb/query http://localhost:8080/pdb/query
ProxyPass /api/pdb/meta http://localhost:8080/pdb/meta
ProxyPassReverse /api/pdb/meta http://localhost:8080/pdb/meta
ProxyPass /api/metrics http://localhost:8080/metrics
ProxyPassReverse /api/metrics http://localhost:8080/metrics

It seems like that URL does not exist anymore.
Am I missing something?

Thanks

build fail on executing grunt

Loading "coffeeify.js" tasks...ERROR

Error: Cannot find module 'esprima'
Warning: Task "coffeeify" not found. Use --force to continue.

fix:
npm install esprima

Show Fact counts on the Dashboard

Request:

If #67 (a new facts drill down page) is fixed, it would also be nice if the Dashboard tab could show cells linking to said page.

The cell itself should simply show a count() of the unique number of values for that fact.

In the dashboard code you need to add something to distinguish between the current querys, whom are directed at the nodes page, to a cell that is instead pointing at the fact page.

  dashboard_panels   => [
    {
      'name'  => 'Nodes with failures',
      'type'  => 'danger',
      'query' => '#node.latest_report_status="failed"'
    },
    {
      'name'  => 'Uptime',
      'type'  => 'info',
      'fact' => 'uptime_days'
    },
    ...and so on...

The keynames 'query' and 'fact' are mutually exclusive, you can only set one.

/Elof

New release version

HI, I've saw a good amount of work on one branch ... Any idea when a new release will be available?

Changelog

Hey,

would be really great if you add the Change Log for 1.4 ... tnx

p.s. - great work with puppetexplorer

Chrome crashes loading the facts tab

my chrome 62 crashes when I'm loading the puppetexplorer/#/facts
probably our facts list is too long. limiting it with paging etc would probably help

Problem with npm test

Hey guys,

I am trying to configure puppetexplorer and PuppetDB to display our workstations' data, but I am having trouble getting it to work. I'm new to Node.js, so maybe I am doing something stupid. Anyway, here goes the error message:

    Running "configureRewriteRules" task
    >> Rewrite rule created for: [REWRITE: ^/config.js$ -> /config.js.example].

    Running "prism:server:mockrecord" (prism) task
    info: Rewrite rule created for: [/^/api/ -> ].
    info: Prism created for: /api to puppetdb.puppetexplorer.io:80

    Running "connect:testserver" (connect) task
    Started connect web server on http://localhost:8001

    Running "mocha_casperjs:files" (mocha_casperjs) task


      Dashboard
        1) "before all" hook

      Node list
        ✓ should display a list of nodes
        ✓ should display a warning if it cannot find any nodes


      2 passing (30s)
      1 failing

      1) Dashboard "before all" hook:
         timeout of 30000ms exceeded. Ensure the done() callback is being called in this test.




    Warning: 1 tests failed Use --force to continue.

    Aborted due to warnings.
    npm ERR! Test failed.  See above for more details.

Using --force doesn't change anything. Could anyone give me some pointers on how to solve this?

Thanks,

Douglas

Comparison operators

Using puppet 1.5.0 since puppetdb version is 2.3.5

=, != and ~ are the only comparison operators that work

using <= returns the error that it's expecting = to be the string
Expecting '@', 'Boolean', 'Number', 'String', got '='

using < returns an Error 500 from the puppetdb

HTTP ERROR: 500

Problem accessing /v4/nodes. Reason:

 Assert failed: (jdbc/valid-jdbc-query? (:results-query %))


Powered by Jetty://

using !~ is a lexical error

Have these issues been resolved in updates? Kindly explain how the error is caused as well.

Thanks!

Bug: Lexical parser prohibits querying on fieldnames including a questionmark

For some reason, the puppetdb people thought it was a good idea to have a questionmark in one of the Events fieldnames: "latest_report?"

From the Events manual:
latest_report? (Boolean): whether the event occurred in the most recent Puppet run (per-node).

If I do a query for "#event.latest_report?=true", I get a red banner complaining about:

Lexical error on line 1. Unrecognized text. 
#event.latest_report?=true
--------------------^

If I try removing the questionmark, I get a red banner stating that I should use a fieldname with the questionmark:

'latest_report' is not a queryable object for events, known queryable objects are ["certname","configuration_version","containing_class","containment_path", "environment","file","latest_report?","line","message","new_value","old_value","property","report",
"report_receive_time","resource_title","resource_type","run_end_time","run_start_time","status",
"timestamp"]

See the "latest_report?" there in the middle.

Please make the lexical parser not bailing on the questionmark character.

Problem with GPG_keys

Hello,

It seems that /etc/pki/rpm-gpg/RPM-GPG-KEY-puppetexplorer is not right for Redhat Like OS.

I'm trying spotify/puppetexplorer 0.4.0 on my environment and puppet run gives :

Error: Execution of '/usr/bin/yum -d 0 -e 0 -y install puppetexplorer' returned 1: warning: rpmts_HdrFromFdno: Header V4 DSA/SHA1 Signature, key ID 84f6ba52: NOKEY

The GPG keys listed for the "Puppet Explorer" repository are already installed but they are not correct for this package.
Check that the correct key URLs are configured for this repository.
Error: /Stage[main]/Puppetexplorer/Package[puppetexplorer]/ensure: change from absent to present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install puppetexplorer' returned 1: warning: rpmts_HdrFromFdno: Header V4 DSA/SHA1 Signature,
key ID 84f6ba52: NOKEY.

Am i doing something wrong ?

Thank you.
Pierre-yves

No 'Access-Control-Allow-Origin' header is present on the requested resource

Hey!
I configured puppetdb to run on 8080 port - it uses it'w own web server(jetty), as far, as I know. My apache is configured on 80 port.
After entering http://puppet/puppetexplorer in my browsser that is what I see in my js log:

XMLHttpRequest cannot load http://puppet:8080/v4/metrics/mbean/com.puppetlabs.puppetdb.query.population:type=default,name=num-nodes. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://puppet' is therefore not allowed access. (index):1
Could not get num-nodes from PuppetDB dashboard.coffee:9
XMLHttpRequest cannot load http://puppet:8080/v4/metrics/mbean/com.puppetlabs.puppetdb.query.population:type=default,name=num-resources. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://puppet' is therefore not allowed access. (index):1
Could not get num-resources from PuppetDB dashboard.coffee:9
XMLHttpRequest cannot load http://puppet:8080/v4/metrics/mbean/com.puppetlabs.puppetdb.query.population:type=default,name=avg-resources-per-node. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://puppet' is therefore not allowed access. (index):1
Could not get avg-resources-per-node from PuppetDB dashboard.coffee:9
XMLHttpRequest cannot load http://puppet:8080/v4/metrics/mbean/com.puppetlabs.puppetdb.query.population:type=default,name=pct-resource-dupes. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://puppet' is therefore not allowed access. (index):1
Could not get pct-resource-dupes from PuppetDB 

I tried to run my google chrome with chromium-browser --disable-web-security and that work. Also, I think I could configure apache proxy, but all these methods are hacky.
What is recommended way to run puppetexplorer?

Show nodes with failed reports in dashboards

Hello,

is there a way to show a list in the dashboard with the nodes that had a failure on the last run?

Something like the Events page ( /#/events?query=&facts=augeasversion&date_from=2014-09-27&date_to=2014-09-27&status=Failure) but on the dashboard

Can't click to page 2 on reports

I was trying to view additional pages of a long puppet report and when I click the next button (or one of the number buttons) I see the page load the new data into the table and then it reloads the data from page one. Watching the network XFR in chrome I see it load the page and then immediately loads page one:
events?include_total=true&limit=50&offset=50&order_by=
events?include_total=true&limit=50&offset=0&order_by=

Also not sure if it's related but I see a bunch of canceled XHR when I first load up the reports page. I've attached some screenshots showing the behavior I'm seeing.

This is a new puppet install, running puppetdb 3.1.

canceled_events
dual_calls

Facts drill down page

Hi!

Request:

In the Facts tab I select "uptime_days" and see a pie-chart of all nodes' uptimes.
I'd like to be able to drill down in this chart to see what nodes have unusually high (or low) uptime.
...or I need to drill down in "kernelrelease" to see what nodes have an odd version (they probably haven't been patched), etc, etc. There are tons of situations where this drill down is needed.

Currently I have to do it manually: look at the chart, find the worst value and create a unique query for it in the Nodes tab. Then repeat the query for the second worst value and so on. Tedious.

I suppose that the drill down need to be presented on a new page (or else the current Facts tab need to be re-designed having the facts and charts above and a nodelist below, simillar to how the Events tab look).

A new page should be easy to fix, I think:
On the Facts tab, simply let the each pie chart link to a new page. This page show this particular chart with drill down details (a node list) shown below.

/Elof

Nodes not populating correctly

I have pupeptboard running on a very simple configuration to evaluate it. Lastest Puppet Open Source and PuppetDB. The inventory is reporting correctly and I'm able to see recent reports. However the node population is 0 on the main page and the node list is empty. I only have 2 nodes, the master and a test vm. I can view their details via puppet with 'puppet node status ' and the PuppetDB performance webpage, currently lists 2 Active nodes in the population. Any direction for troubleshooting?

EVENTS tab display error ["select_nodes" ["<" "report_timestamp" "2017-02-07T13:38:28.066Z"]] is not well-formed: query operator 'select_nodes' is unknown

I have an error under EVENTS where no data is showing and this error message is displayed:

################
["select_nodes" ["<" "report_timestamp" "2017-02-07T13:38:28.066Z"]] is not well-formed: query operator 'select_nodes' is unknown
################

puppet-2016.5.1-learning-5.9 VM
puppetexplorer 2.0.0 from CentOS 7 Yum repository


vhost.conf
root@puppetmaster:~ # cat /etc/httpd/conf.d/puppetexplorer.conf
<VirtualHost *:8443>
ServerName puppetmaster.localdomain.loc
ServerAlias puppetmaster

Vhost docroot

DocumentRoot "/usr/share/puppetexplorer"

Directories, there should at least be a declaration for /usr/share/puppetexplorer

<Directory "/usr/share/puppetexplorer">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Require all granted

Logging

ErrorLog "/var/log/httpd/puppetexplorer_error_ssl.log"
ServerSignature Off
CustomLog "/var/log/httpd/puppetexplorer.log" combined

PuppetDB 4 support

RewriteEngine On
RewriteRule ^/api/metrics/v1/mbeans/puppetlabs.puppetdb.query.population:type=default,name=(.*)$ https://%{HTTP_HOST}/api/metrics/v1/mbeans/puppetlabs.puppetdb.population:name=$1 [R=301,L]

Proxy rules

ProxyRequests Off

ProxyPass /api/pdb/query http://localhost:8080/pdb/query
<Location /api/pdb/query>
ProxyPassReverse http://localhost:8080/pdb/query

ProxyPass /api/pdb/meta http://localhost:8080/pdb/meta
<Location /pdb/meta>
ProxyPassReverse http://localhost:8080/pdb/meta

ProxyPass /api/metrics/v1/mbeans http://localhost:8080/metrics/v1/mbeans
<Location /api/metrics/v1/mbeans>
ProxyPassReverse http://localhost:8080/metrics/v1/mbeans

SSL directives

SSLEngine on
SSLCertificateFile "/etc/puppetlabs/puppet/ssl/certs/learning.puppetlabs.vm.pem"
SSLCertificateKeyFile "/etc/puppetlabs/puppet/ssl/private_keys/learning.puppetlabs.vm.pem"
SSLCACertificatepath "/etc/puppetlabs/puppet/ssl/certs"

SSLProxyEngine On
SSLProtocol All -SSLv2 -SSLv3 -TLSv1
SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK


puppetexplorer/config.js

root@puppetmaster:~ # cat /usr/share/puppetexplorer/config.js
// List of PuppetDB servers, pairs of name, URL and $http config object
// The first one will be used as the default server
PUPPETDB_SERVERS = [
['production', '/api']
// ['testing', '/']
];

// A list of important facts that you want shown in the node detail view
NODE_FACTS = [
'operatingsystem',
'operatingsystemrelease',
'manufacturer',
'productname',
'processorcount',
'memorytotal',
'ipaddress'
];

// The amount of hours since the last check-in after which a node is considered
// unresponsive
UNRESPONSIVE_HOURS = 2;

// Customisable dashboard panels
// type can be either 'primary', 'success', 'info', 'warning' or 'danger'
// Different types will be displayed with different colors
DASHBOARD_PANELS = [
{
name: 'Unresponsive nodes',
type: 'danger',
query: '#node.report_timestamp < @"now - 2 hours"'
},
{
name: 'Nodes in production env',
type: 'success',
query: '#node.catalog_environment = production'
},
{
name: 'Nodes in non-production env',
type: 'warning',
query: '#node.catalog_environment != production'
}
];

// Google Analytics settings
// GA_TRACKING_ID = 'UA-XXXXXXXX-YY';
// GA_DOMAIN = 'auto';

Widgets on the dashboard, where "Pending jobs" is the most crucial

In config.js(.example), please add something like this (I'm no programmer but I think you get the idea):

DASHBOARD_PANELS = [
  {"name":"Nodes with failures","type":"danger","query":"#node.latest_report_status=\"failed\""},
  {"name":"Nodes with pending jobs","type":"warning","query":"#report { latest_report?=true and noop_pending=true }"},
  {"name":"Unresponsive nodes (within last ${UNRESPONSIVE_HOURS}h)","type":"danger","query":"#node.report_timestamp < @\"now - $UNRESPONSIVE_HOURS hours\""},
  {"name":"Nodes in production env","type":"success","query":"#node.catalog_environment = production"},
  {{"name":"Nodes in non-production env",type:"warning",query:"#node.catalog_environment != production"}}
];

Add a dashboard for "Nodes with pending jobs".

I have cron run 'puppet agent -t --noop' every now and then on all my nodes.

Normally these noops show up as grey icons in the Nodes tab in Puppet Explorer, as there's nothing to do. The nodes are up to date. Everything is good.

However, if the noop-run show pending changes, this is indicated with a blue icon in the Node tab.

It is crucial to me to have this as a dashboard widget, as it will show how many of my nodes are NOT up to date.

Before you can add this dashboard, you need to fix the bug in dalen/node-puppetdbquery#1, since the query contain a questionmark.
#report { latest_report?=true and noop=true and status="unchanged" }

I almost consider the following a bug:

In the 'Unresponsive nodes' widget you're using a static query like this:
'#node.report_timestamp < @"now - 2 hours"'

This forces the widget to use 2 hours, even though the user can configure the UNRESPONSIVE_HOURS variable to e.g. 24h earlier in the file.

Update to something like this: '#node.report_timestamp < @"now - $UNRESPONSIVE_HOURS hours"'

This is a bit overkill, but it's just a simple if-statement:

If the puppet-db only deal with one single environment, "production", I think you should hide the 'Nodes in non-production env' widget from the dashboard. Otherwise it will always show "0" and just waste screen space for users like me. :-)

if ( total number of environments > 1 ) then
show the 'Nodes in non-production env' widget
fi

Requesting v4 when using 1.5.0

Greetings,

I have a separate puppetDB server and I have these packages installed:

rpm -qa | grep -i puppet

puppet-3.8.2-1.el6.noarch
puppetexplorer-1.5.0-1.noarch
puppetdb-2.3.6-1.el6.noarch

I used the spotify-puppetexplorer v1.0.1 puppet module from the forge to install and knowing that the latest 2.0 does not work with my version of puppetdb (2.3.6), I manually installed puppetexplorer.

Initially I started with this in my site.pp:
class { 'puppetexplorer': manage_yum => false,}

However, all it did was show spinning icons (much like how http://demo.puppetexplorer.io currently does). I traced things down a bit and when I put this http://127.0.0.1:8080/v3/metrics/mbean/java.lang:type=Memory into firefox (running on the puppetdb server) I get the message "must accept application/json" but I can see data when I mess around with curl.

When I put http://my.fqdn/api/metrics/mbean/java.lang:type=Memory into firefox I get "Not Found".

So I read about the proxy pass and I adjusted it to this;
class { 'puppetexplorer': manage_yum => false, proxy_pass => [
{ 'path' => 'http://my.fqdn//api/pdb/query', 'url' => 'http://localhost:8080/v3/pdb/query' },
{ 'path' => 'http://my.fqdn/api/pdb/meta', 'url' => 'http://localhost:8080/v3/pdb/meta' },
{ 'path' => 'http://my.fqdn//api/metrics', 'url' => 'http://localhost:8080/v3/metrics' }
]}

Re-ran 'puppet agent -t' and now when I go to my puppet dashboard I see this:

<title>404 Not Found</title>

Not Found

The requested URL /api/v4/nodes was not found on this server.

Say what? v4? Where is it getting that from? I ran a recursive grep on my entire disk and I can't find where it is pulling v4 from. I wiped everything I could from puppetexplorer hoping to dump out some bad cache file or something and I tried it again. Same error. :-/

Also, I still get spinning things still and despite the proxy pass being in apache I still get "Not Found" when I connect to http://my.fqdn/api/metrics/mbean/java.lang:type=Memory .

The only thing I see in the apache log is "File does not exist: /usr/share/puppetexplorer/api" (which is a valid statement; but I am not sure what to do with it).

It would be really nice if there were some better examples of how this is supposed to work as well some information on how to debug it when things like this are going wrong.

Any help would be greatly appreciated.

Multiple PuppetDB support

Hi, I'm having issues with multiple puppetDB support on version 1.5:

puppetdb_servers =>[
['prod', '/api'],
['nonprod', '/apinonprod'],
]
proxy_pass => [
{ 'path' => '/api/', 'url' => "http://${puppetdb_prod}:8080/" },
{ 'path' => '/apinonprod/', 'url' => "http://${puppetdb_dev}:8080/" },
]

Based on my understanding, the the first array maps the environments with the puppetDB servers which I wish to use, while the second array maps every local path to the real puppetDB server.

However I can't see any link/background calls calling the non-default endpoint. All the calls are going to /api. (If I'm changing the order of the objects in puppetdb_servers, nonprod is the default, every call goes to /apinonprod)

Is it a bug or a feature? What am I doing wrong?
(puppetdb version: 2.3, puppetExplorer version: 1.5)

Puppet Explorer: Date range for events not working

Good morning

I recently installed Puppet Explorer the recommended way as a module on the same host as the PuppetDB is running on. It works great in general, but it's not possible to set the date range under "events". If I select a date range (e.g 2016-08-02 - 2016-08-04), no data is shown.

The problem seems to be, that the address (and therefore the request) is not updated if I select a date. If I edit the URL manually (e.g. https://host.something.com/#/events?mode=daterange&date_from=2016-08-02&date_to=2016-08-04) it works like a charm.

Some additional information:

  • PuppetDB 4.1
  • RHEL 7.2
  • With /api proxy as recommended
  • Tested in current browsers (Chrome, Firefox, Safari)

Any help is appreciated. Thank you.

Chris

[ngRepeat:dupes] Duplicates in a repeater are not allowed

Hi,

When selecting facts I am getting the below error:
screen shot 2016-01-11 at 20 16 29

[ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: factCompontent in fact.path, Duplicate key: number:0, Duplicate value: 0

I am using Redhat 6.6 and my node is an instance in google compute.
puppet explorer v2.0.0
puppetdb v3.2.2
facter v3.1.3

Not sure if the below is related to the error but I also noticed two facts that were not being rendered:
screen shot 2016-01-11 at 20 18 07

When I select those I could see the graphs and they showed that the two facts were:
GCE.INSTANCE.NETWORKINTERFACES.0.ACCESSCONFIGS.0.EXTERNALIP
GCE.INSTANCE.NETWORKINTERFACES.0.ACCESSCONFIGS.0.TYPE

not working with firefox

Hi,,

Last version is no more working with firefox :

"TypeError: Error.captureStackTrace is not a function"

Missing dependencies ?

On a fresh install of npm and grunt on a redhat 6.5, using EPEL, i got:

$git pull
Already up-to-date.
$ npm install
npm WARN package.json [email protected] No repository field.
npm WARN cannot run in wd [email protected] napa bouil/angular-google-chart (wd=/root/puppetexplorer)
$ grunt
Running "clean:0" (clean) task

Running "clean:1" (clean) task

Running "coffeeify:files" (coffeeify) task
Warning: module "angular-google-chart/ng-google-chart" not found from "/root/puppetexplorer/app/app.coffee" Use --force to continue.

Aborted due to warnings.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.