Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No data on icinga2-Dashboard #115

Closed
Marco-Total opened this issue Jan 12, 2021 · 4 comments
Closed

No data on icinga2-Dashboard #115

Marco-Total opened this issue Jan 12, 2021 · 4 comments

Comments

@Marco-Total
Copy link

we have recently installed the Icinga2 dashboard, unfortunately no information from Icinga2 is displayed after calling the page:
Screenshot 2021-01-12 160825

Steps to Reproduce (for bugs)

yum makecache
yum -y install epel-release
yum -y install rubygems rubygem-bundler ruby-devel openssl gcc-c++ make nodejs

cd /usr/share/
git clone https://github.com/mocdaniel/dashing-icinga2.git
cd dashing-icinga2

#API users added
nano /etc/icinga2/conf.d/api-users.conf

#Connection test with the previously created API user:
curl -k -s -u test:test 'https://localhost:5665/v1/status/IcingaApplication?pretty=1'
{
    "results": [
        {
            "name": "IcingaApplication",
            "perfdata": [],
            "status": {
                "icingaapplication": {
                    "app": {
                        "enable_event_handlers": true,
                        "enable_flapping": true,
                        "enable_host_checks": true,
                        "enable_notifications": true,
                        "enable_perfdata": true,
                        "enable_service_checks": true,
                        "environment": "",
                        "node_name": "server.domain.local",
                        "pid": 3328618.0,
                        "program_start": 1610462107.871337,
                        "version": "2.12.3"
                    }
                }
            }
        }
    ]

cp /usr/share/dashing-icinga2/config/icinga2.json /usr/share/dashing-icinga2/config/icinga2.local.json

service dashing-icinga2 restart

So far so good...
Unfortunately, no data is displayed when calling the Dashing page.

## Context
Content thin.log
tail -f /usr/share/dashing-icinga2/log/thin.log
192.168.1.10 - - [12/Jan/2021 16:10:00] "GET /events HTTP/1.1" 200 - 6.3616
First trying to read environment variables
Environment variables not found, falling back to configuration file config/icinga2.json
Detecting local config file '/usr/share/dashing-icinga2/config/icinga2.local.json'.
Using config file '/usr/share/dashing-icinga2/config/icinga2.local.json'.
Reading config{"icinga2"=>{"api"=>{"host"=>"localhost", "port"=>5665, "user"=>"test", "password"=>"test"}}, "icingaweb2"=>{"url"=>"http://localhost/icingaweb2"}, "dashboard"=>{"show_only_hard_state_problems"=>false, "timezone"=>"UTC"}}
First trying to read environment variables
Environment variables not found, falling back to configuration file config/icinga2.json
Detecting local config file '/usr/share/dashing-icinga2/config/icinga2.local.json'.
Using config file '/usr/share/dashing-icinga2/config/icinga2.local.json'.
Reading config{"icinga2"=>{"api"=>{"host"=>"localhost", "port"=>5665, "user"=>"test", "password"=>"test"}}, "icingaweb2"=>{"url"=>"http://localhost/icingaweb2"}, "dashboard"=>{"show_only_hard_state_problems"=>false, "timezone"=>"UTC"}}
First trying to read environment variables
Environment variables not found, falling back to configuration file config/icinga2.json
Detecting local config file '/usr/share/dashing-icinga2/config/icinga2.local.json'.
Using config file '/usr/share/dashing-icinga2/config/icinga2.local.json'.
Reading config{"icinga2"=>{"api"=>{"host"=>"localhost", "port"=>5665, "user"=>"test", "password"=>"test"}}, "icingaweb2"=>{"url"=>"http://localhost/icingaweb2"}, "dashboard"=>{"show_only_hard_state_problems"=>false, "timezone"=>"UTC"}}
First trying to read environment variables
Environment variables not found, falling back to configuration file config/icinga2.json
Detecting local config file '/usr/share/dashing-icinga2/config/icinga2.local.json'.
Using config file '/usr/share/dashing-icinga2/config/icinga2.local.json'.
Reading config{"icinga2"=>{"api"=>{"host"=>"localhost", "port"=>5665, "user"=>"test", "password"=>"test"}}, "icingaweb2"=>{"url"=>"http://localhost/icingaweb2"}, "dashboard"=>{"show_only_hard_state_problems"=>false, "timezone"=>"UTC"}}
192.168.1.10 - - [12/Jan/2021 16:10:00] "GET /icinga2 HTTP/1.1" 200 7187 0.0160
192.168.1.10 - - [12/Jan/2021 16:10:00] "GET /views/clock.html HTTP/1.1" 200 82 0.0009
192.168.1.10 - - [12/Jan/2021 16:10:00] "GET /views/list.html HTTP/1.1" 200 613 0.0025
192.168.1.10 - - [12/Jan/2021 16:10:00] "GET /views/meter.html HTTP/1.1" 200 375 0.0008
================================================================================
scheduler caught exception:
no implicit conversion of nil into String
/usr/share/dashing-icinga2/lib/icinga2.rb:662:in `+'
/usr/share/dashing-icinga2/lib/icinga2.rb:662:in `block in getProblemServices'
/usr/share/dashing-icinga2/lib/icinga2.rb:652:in `each'
/usr/share/dashing-icinga2/lib/icinga2.rb:652:in `getProblemServices'
/usr/share/dashing-icinga2/lib/icinga2.rb:854:in `run'
/usr/share/dashing-icinga2/jobs/icinga2.rb:27:in `block in <top (required)>'
/usr/share/gems/gems/rufus-scheduler-2.0.24/lib/rufus/sc/jobs.rb:230:in `trigger_block'
/usr/share/gems/gems/rufus-scheduler-2.0.24/lib/rufus/sc/jobs.rb:204:in `block in trigger'
/usr/share/gems/gems/rufus-scheduler-2.0.24/lib/rufus/sc/scheduler.rb:430:in `block in trigger_job'
================================================================================

Content icinga2.log:
[2021-01-12 16:12:27 +0100] information/ApiListener: New client connection from [127.0.0.1]:42504 (no client certificate)
[2021-01-12 16:12:27 +0100] information/HttpServerConnection: Request: GET /v1/status/IcingaApplication (from [127.0.0.1]:42504), user: dashing, agent: rest-client/2.1.0 (linux-gnu x86_64) ruby/2.5.5p157, status: OK).
[2021-01-12 16:12:27 +0100] information/HttpServerConnection: HTTP client disconnected (from [127.0.0.1]:42504)
[2021-01-12 16:12:27 +0100] information/ApiListener: New client connection from [127.0.0.1]:42508 (no client certificate)
[2021-01-12 16:12:27 +0100] information/HttpServerConnection: Request: GET /v1/status/CIB (from [127.0.0.1]:42508), user: dashing, agent: rest-client/2.1.0 (linux-gnu x86_64) ruby/2.5.5p157, status: OK).
[2021-01-12 16:12:27 +0100] information/HttpServerConnection: HTTP client disconnected (from [127.0.0.1]:42508)
[2021-01-12 16:12:27 +0100] information/ApiListener: New client connection from [127.0.0.1]:42512 (no client certificate)
[2021-01-12 16:12:27 +0100] information/HttpServerConnection: Request: GET /v1/objects/hosts (from [127.0.0.1]:42512), user: dashing, agent: rest-client/2.1.0 (linux-gnu x86_64) ruby/2.5.5p157, status: OK).
[2021-01-12 16:12:27 +0100] information/HttpServerConnection: HTTP client disconnected (from [127.0.0.1]:42512)
[2021-01-12 16:12:27 +0100] information/ApiListener: New client connection from [127.0.0.1]:42516 (no client certificate)
[2021-01-12 16:12:27 +0100] information/HttpServerConnection: Request: GET /v1/objects/services (from [127.0.0.1]:42516), user: dashing, agent: rest-client/2.1.0 (linux-gnu x86_64) ruby/2.5.5p157, status: OK).
[2021-01-12 16:12:27 +0100] information/HttpServerConnection: HTTP client disconnected (from [127.0.0.1]:42516)

Your Environment

  • Dashing version (gem list --local dashing): dashing (1.3.7)
  • Ruby version (ruby -V): ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]
  • Version of this project (tarball name, tag name or git show -1): commit d7fd55d (HEAD -> master, origin/master, origin/HEAD)
  • Modifications to this project, if any (git diff):
  • Operating System and version: CentOS 8
  • Client browser and version: Chrome / Firefox

From our point of view, the access from the dashboard to the Icinga2 API is working (see HTTP 200), does anyone have a tip for us on how to fix it?

Thanks a lot for the help!!!

Greetings Rudi

@mocdaniel
Copy link
Owner

mocdaniel commented Jan 12, 2021

Hi Rudi,

thank you for providing so much information already. I reproduced your issue and it looks like v3.1.0 broke something I did not notice before. I will have to look into the matter further, until then you can try using v3.0.0 by cloning the tag:

git clone --depth 1 --branch v3.0.0 https://github.com/mocdaniel/dashing-icinga2.git

v3.0.0 worked just fine on 'your' setup for me.

I will report back in this thread once I sorted out the issues with v3.1.0

@mocdaniel
Copy link
Owner

mocdaniel commented Jan 12, 2021

Hi again, I pushed some minor changes to master which seem to fix the issues, apparently some functions became deprecated at some point, I don't use Ruby all too much outside of this repository.

It would be nice if you could confirm that the changes work for you so I can close this issue :)

Best,
Daniel

@Marco-Total
Copy link
Author

Hi Daniel,

thanks for the quick feedback! With the current version the access works again without problems. Also in the LOG now no errors are displayed.

Thanks again!

@mocdaniel
Copy link
Owner

Great, glad we could fix your issue that quickly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants