Dashinga2 - Minor update to the Dashing Demo

  • I made a small update for the Dashing Demo, mainly adding two Tables for Service Problems and Host Problems.


    Im a total beginner at ruby, so if anyone wants to help out: https://github.com/micke2k/dashinga2.


    Example on how to set it up on Centos:


    And then access it on http://youripaddress:3030


    Any input is welcome! Enjoy!

  • Nice. You could've sent in a patch upstream as well, maybe you'll just do that too? :)


    Btw - rest_client is deprecated. rest-client is the one which needs to be adopted.

    The code is absolutely terrible.. i was to ashamed of it to make a pull :D


    Im almost 100% sure it wont be accepted, but look through it, and if there is anything that you think fits the upstream ill make a pull.


    There was an existing pull that was 5 months old, so i thought you let this little nugget go.

  • Oh, no that PR slipped through. To be honest I am not actively developing the dashing-icinga2 project, only looking into it from time to time. I've got too many things on my TODO list, but this one really helped me show-case what you can achieve with the Icinga 2 API. In a simple and useful way anyone might re-use the code and create awesome dashboards.


    It is far from perfect, and I've seen that you've fixed the uptime formatting. I was too much in a hurry to look that one up. So I'd appreciate a patch for that for example :)
    Or you're fixing a glitch with Chrome/IE ... I also don't mind changing the layout. It is a demo, and as you know, a demo is never 100% complete.


    I was thinking to add a default pane for integrating a grafana graph. Or additional metric display, e.g. querying a remote interface for open tickets (redmine from dev.icinga.org for demo purposes for example).


    I also want to rewrite that using rest-client. Didn't catch for Icinga Camp Berlin, but I might for for Icinga Camp Amsterdam by the end of June then.

  • yeah by looking at dev.icinga.org it looks like you dont have time for much else than making icinga2/director/web2 better :)


    The example you made is awesome, and really easy to build on.


    Ill submit patches for the small things i changed, and when i cleaned up my tables code ill submit them as well.


    One things i really miss in icinga2 is the nagios-style hostgroup(shows indiviual hosts in the hostgroup) page, i was thinking of adding that later to the dashing.


    Thanks for the input!

  • You somehow got me.


    I've removed the deprecated rest_client usage, updated the README with proper ApiUser credentials and permissions and finally wrote a small nifty restart-dashing script.


    https://github.com/Icinga/dashing-icinga2/commits/master


    That will allow simpler local tests outside the Vagrant box when working on enhancing the Dashing jobs.

  • Hehe, didnt mean to waste your weekend time on this, but great! Were in business again :)


    I couldn't submit a pull from my fork(it has to many changes), so i had to delete it. I made a new project for mine, and kept yours as a clean fork so i can submit any small bug fixes/patches.


    I added a pull and opened an issue at dev.icinga


    Im going a bit different route with mine:

  • Cool thanks :)


    I see where are you heading at, and that's probably slightly different for the demo stuff we may have floating around (e.g. inside the Vagrant boxes, there's Grafana, and remotely there are several APIs to query).


    Though I'd like to restructure the icinga2 rest client (remove it from the jobs and make it a separate class somehow. Then it would be fairly easy to also fetch the host/service objects, their names, limit by X, and so on. Everything wrapped into a connection and processing class.

  • Awesome, would be great!


    On another note, do you have any idea about the chrome bug?


    All the widgets start to flash grey. If i open it on another host with chrome it works fine. It seems as if the client caches something.


    Changing simplemon.coffee to:


    Code
    1. checkUpdate: =>
    2. if updatedAt = @get('updatedAt')
    3. timestamp = new Date(updatedAt * 2000)
    4. now = new Date()
    5. diff = now.getTime() - timestamp.getTime()
    6. if diff > 3000
    7. @onData({color:'grey'})

    From:



    Code
    1. checkUpdate: =>
    2. if updatedAt = @get('updatedAt')
    3. timestamp = new Date(updatedAt * 1000)
    4. now = new Date()
    5. diff = now.getTime() - timestamp.getTime()
    6. if diff > 30000
    7. @onData({color:'grey'})


    This fixes the issue, but then it will never go gray if it looses connection.


    You can see in the gif that class: color-grey goes nuts and tries to leave :)

  • Sorry... but the hosts and service detail information doesn't work for me... get no info there.

    What can it be after I replaced the jobs/icinga2.rb file from micke2k in dashing-icinga2/jobs of dnsmichis solution?

    Thanks :-)

  • I'm sorry to rescue up this topic, I'm trying to do a dashboard where I can have a list of all host problems and another with all service problems but I seem to be unable to do it... Does this example works in icinga2-dashing?

  • I mean the default dashboard plus a widget displaying hosts with problems and another with services with problems

  • I've to search the forum for some example... I'm actually kind new in ruby...


    I've changed the code on the .rb file to read


    Code
    1. #problem hosts
    2. host_severity_stats = []
    3. icinga.host_problems_severity.each do |name, state|
    4. host_severity_stats.push ({ "label" => icinga.formatService(name) })
    5.  end
    6.   puts "Severity: " + host_severity_stats.to_s
    7.   
    8.    send_event('icinga-severity-host', {
    9.    items: host_severity_stats,
    10.    color: 'blue' }) 


    I've changed the service to host.. but I get no return on the dashboard :(

  • Code
    1. <!-- Takes two rows for all service problems by severity -->
    2. <li data-row="1" data-col="5" data-sizex="1" data-sizey="2">
    3. <div data-id="icinga-severity-host" data-view="List" data-unordered="true" data-title="ProblemsHosts" style="background-color: #0095bf;"></div>
    4. </li>-->


    here it is