Showing posts with label dashboard. Show all posts
Showing posts with label dashboard. Show all posts

Friday, April 6, 2018

Puppet Dashboard - Directory Index Forbidden

Leave a Comment

I also have issue on launching the Puppet Dashboard UI, Below is my config file. can anyone help me on this issue please.

Error I am getting :

[Thu Aug 20 05:25:09 2015] [error] [client 192.168.XXX.XXX] Directory index forbidden by Options directive: /usr/share/puppet-dashboard/public/

Below is my VirtualHost file.

# UPDATE THESE PATHS TO SUIT YOUR ENVIRONMENT #LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-2.2.11/ext/apache2/mod_passenger.so PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-5.0.15 PassengerRuby /usr/bin/ruby  # you may want to tune these settings PassengerHighPerformance on PassengerMaxPoolSize 12 PassengerPoolIdleTime 1500 # PassengerMaxRequests 1000 PassengerStatThrottleRate 120 #RailsAutoDetect On Listen 3000  <VirtualHost *:3000>         ServerName puppetma.domain.net         ServerAlias puppetma         DocumentRoot /usr/share/puppet-dashboard/public/ <Directory /usr/share/puppet-dashboard/public/>                 Options None                 Order allow,deny                 allow from all         </Directory>   ErrorLog /var/log/httpd/puppet-dashboard_error.log   LogLevel warn   CustomLog /var/log/httpd/puppet-dashboard_access.log combined   ServerSignature On 

I could see my DNS is absolutely working fine, I have also ensured stopping my host level firewall and selinux.

Thanks

EDIT

[admin@$$$]$ pwd /usr/share/puppet-dashboard/public drwxr-xr-x  5 puppet-dashboard puppet-dashboard 4.0K Apr  3 17:46 . drwxr-xr-x 17 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:39 .. -rwxr-xr-x  1 puppet-dashboard puppet-dashboard 1006 Mar 21  2013 404.html -rwxr-xr-x  1 puppet-dashboard puppet-dashboard  989 Mar 21  2013 422.html -rwxr-xr-x  1 puppet-dashboard puppet-dashboard 1.2K Mar 21  2013 500.html drwxr-xr-x  3 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:39 images drwxr-xr-x  2 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:39 javascripts -rwxr-xr-x  1 admin            admin             18K Apr  3 17:46 puppet_dashboard.sql -rwxr-xr-x  1 puppet-dashboard puppet-dashboard   26 Mar 30 15:42 robots.txt drwxr-xr-x  4 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:39 stylesheets  [admin@$$$]$ pwd /usr/share/puppet-dashboard drwxr-xr-x   17 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:39 . drwxr-xr-x. 127 root             root             4.0K Apr  3 16:55 .. drwxr-xr-x    7 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:39 app drwxr-xr-x    2 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:39 bin drwxr-xr-x    2 puppet-dashboard puppet-dashboard 4.0K Mar 21  2013 certs drwxr-xr-x    5 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:59 config drwxr-xr-x    3 puppet-dashboard puppet-dashboard 4.0K Mar 29 13:00 db drwxr-xr-x    2 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:39 examples drwxr-xr-x    4 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:39 ext drwxr-xr-x    4 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:39 lib drwxr-xr-x    2 puppet-dashboard puppet-dashboard 4.0K Mar 31 03:24 log drwxr-xr-x    5 puppet-dashboard puppet-dashboard 4.0K Apr  3 17:46 public -rwxrwxrwx    1 puppet-dashboard puppet-dashboard 1.7K Mar 21  2013 Rakefile drwxr-xr-x    3 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:39 script drwxr-xr-x   10 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:39 spec drwxr-xr-x    2 puppet-dashboard puppet-dashboard 4.0K Mar 21  2013 spool drwxr-xr-x    2 puppet-dashboard puppet-dashboard 4.0K Mar 21  2013 tmp drwxr-xr-x    5 puppet-dashboard puppet-dashboard 4.0K Mar 29 11:39 vendor -rw-r--r--    1 puppet-dashboard puppet-dashboard    7 Mar 21  2013 VERSION 

1 Answers

Answers 1

Maybe this will help?

1) In the /etc/httpd/conf.d/welcome.conf change the:

Options -Indexes to Options Indexes (You may want to comment out the lines completely - depends what exactly you need).

2) Second thing maybe you just need to adjust the +x (execute) rights for your /usr/share/puppet-dashboard/public/ directory.

Try running chmod 777 /usr/share/puppet-dashboard/public/ which will give all to users, group, world. Please don't forget to adjust it correctly afterwards you are finished. If you want to run the chmod recursively add -R option.

Read More

Saturday, March 10, 2018

What's the best way to save test data to a database from jenkins/hudson?

Leave a Comment

I'm trying to make a dashboard for test results (dynamically filtered by os/hardware/ect tags) from jenkins.

What's the best way for jenkins to save test results from an xml file to a central db(preferably postgres)?

The sql plugins seem to be designed to be used by other plugins.

Should I just call java sql apis from jenkins.groovy script?

3 Answers

Answers 1

Several possibilities:

Use an existing java sql library with Grab

There are several world class java sql libs out there (https://commons.apache.org/proper/commons-dbutils/, https://github.com/jOOQ/jOOQ) which you can use in your pipeline in conjunction with Grab. Personally I love jooq. Then you write your specific code in groovy.

@Grab(group='org.jooq', module='jooq', version='3.10.5') import ... 

Use an existing java library and put it on the classpath

Like the solution above. But you don't import the library with Grab. Instead starting jenkins from the war directly, you maintain your own jetty installation (https://wiki.jenkins.io/display/JENKINS/Jetty). This provides you the freedom to add additional libraries to the classpath, which can be used then in the pipelines.

Write a java library and use it with Grab or classpath

Instead of using a general purpose library and code your specific requirements in groovy. You create a library, which provides an API for your needs. You import it with Grab or you add it to the classpath of the application server. In your groovy scripts you just have to call the specific API and pass the parameters.

Write your own plugin

You can write a plugin for your purpose which is not so difficult https://jenkins.io/doc/developer/plugin-development/pipeline-integration/. The plugin would take the file path as parameter. The contract will be the structure (xml schema) of the xml file. You could also add parameters to control the import.

Personal opinion:

I would go with "Write a java library and use it with Grab or classpath":

  • good testing possibilities on unit level, because of simplicity
  • no dependency of the implementation of the specific requirements to jenkins, means can also be used without jenkins
  • easy to distribute, can be deployed to any maven compliant repository and fetched from there @GrabResolver(name='custom', root='http://customserver/repo', m2Compatible='true')

Answers 2

What we are using at the company (and at some other projects I've involved) is the FluentD. You can find a well-maintained Jenkins plugin here or here.

The main features are: sending any valid json, which can be analyzed later using your own tool, something like ELK stack (you can find a lot HOWTO articles), or some other stacks.

Why FluentD? I guess it clearly states on the author's github page: " Our choice was to use Fluentd as looks mature enough to handle a lot of data and it supports a lot of destination endpoints (DBs, file, http, etc)." The data outputs could be anythong you wantL Hadoop, Mongo, S3, AWS/Azure services, or any existing database (https://www.fluentd.org/dataoutputs), and a lot of visualization.

I assume you can ask "why not push it directly to the database?". The answer is - you will need to push it in a specific format and the data won't be easily formatted to another one. I.e. You've built your own tool, but later realized you can use Kibana instead, so you'll need to migrate over. If you start using the FluentD, the only thing you should think about is how to format the json, which is much more trivial, than designing a database. Also, FluentD is highly scalable and supports robust failovers.

One more potential issue is converting XML, you've mentioned you have as test output, to json. First of all, a lot of test runners support json formatting. Secondly, there's a common method of generating json out of xml and I would suggest something like "xml2json" tool, which does a pretty good job:

XML JSON

<e/>                             "e": null <e>text</e>                      "e": "text" <e name="value" />               "e": { "@name": "value" } <e name="value">text</e>         "e": { "@name": "value", "#text": "text" } <e> <a>text</a ><b>text</b> </e> "e": { "a": "text", "b": "text" } <e> <a>text</a> <a>text</a> </e> "e": { "a": ["text", "text"] } <e> text <a>text</a> </e>        "e": { "#text": "text", "a": "text" } 

Answers 3

Also you can do it via database REST API. Just call sh in your pipeline and put an artifact in a database.

sh("curl http://database:8080/api --verbose -X PUT \                   -H "Content-Type: application/xml"          ... ) 
Read More

Saturday, April 23, 2016

How to combine row and column layout in flexdashboard?

Leave a Comment

For a new project I want to try the new flexdasboard package. I am thinking of a lay out in which the column and row orientation is somehow combined.

The layout I am thinking of is something like this:

enter image description here

If I change this code:

--- title: "Focal Chart (Left)" output: flexdashboard::flex_dashboard ---  Column {data-width=600} -------------------------------------  ### Chart 1  ```{r} ```  Column {data-width=400} -------------------------------------  ### Chart 2  ```{r} ```     ### Chart 3  ```{r} ``` 

into this:

--- title: "Focal Chart (Left)" output: flexdashboard::flex_dashboard ---  Column {data-width=600} -------------------------------------  ### Chart 1  ```{r} ```  Column {data-width=400} -------------------------------------  Row {data-width=400} -------------------------------------  ### Chart 2  ```{r} ```     ### Chart 3  ```{r} ```     Row {data-width=400} -------------------------------------  ### Chart 4  ```{r} ``` 

(ofcourse) this doesn't work, but I haven't figured out the right way. Does anyone have an idea?

1 Answers

Answers 1

This does not seem easy using basic rows and columns, but can be achieved by using a sidebar to hold the content of the left hand panel. This will change the formatting of the left panel slightly compared to the others, but can achieve the layout you described nonetheless. N.B. See UPDATE below for notes on how to alter the apperance of the sidebar panel. Note that you can alter the width of the side bar using the data-width option e.g. {.sidebar data-width=300}

--- title: "Focal Chart" output:    flexdashboard::flex_dashboard:     orientation: rows ---  Column {.sidebar data-width=500} ------------------------------------- ### Chart 1 ```{r} ```  Row {data-height=350} ------------------------------------- ### Chart 2 ```{r} ```  ### Chart 3 ```{r} ```     Row {data-height=650} ------------------------------------- ### Chart 4 ```{r} ``` 

Which gives...

enter image description here

UPDATE

The appearance of the side bar can then be edited to your liking. For example:

To

  1. change the background color of the side panel to white (if you want it to match the other panels),
  2. align the top edge with the other panels, and
  3. add borders left and bottom to match the other panels:

edit the css style sheet for .section.sidebar to

.section.sidebar {   top: 61px;   border-bottom: 10px solid #ececec;   border-left: 10px solid #ececec;   background-color: rgba(255, 255, 255, 1); } 

To change the padding, use the data-padding option in flexdashboard markdown:

Column {.sidebar data-width=500 data-padding=10} 

Now, it looks like this:

enter image description here

Read More