We are starting to try a Dashing and try to show data only for some Hostgroups/Servicegroups.
Related to the iframe - we use a login with assigned 2 roles:
PROD: hostgroup_name=PROD&servicegroup_name=PROD
TEST: hostgroup_name=TEST&servicegroup_name=TEST
Now, we want to apply such filters to the Dashing.
Can someone provide an example of the filter and how we should apply it. For example: all_hosts_data = getHostObjects([ "name", "state", "acknowledgement", "downtime_depth", "last_check" ], hostgroup_name=PROD&servicegroup_name=PROD, nil)
Should we just change nil to the filter from Icinga?
[root@dashboard dashing-icinga2]# dashing start -p 8005
/usr/local/share/gems/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require': /usr/share/dashing-icinga2/lib/icinga2.rb:750: syntax error, unexpected keyword_in, expecting ')' (SyntaxError)
...epth", "last_check"], "PROD" in host.groups, nil)
... ^
/usr/share/dashing-icinga2/lib/icinga2.rb:750: Can't assign to nil
/usr/share/dashing-icinga2/lib/icinga2.rb:750: syntax error, unexpected ')', expecting '='
from /usr/local/share/gems/gems/backports-3.15.0/lib/backports/std_lib.rb:9:in `require_with_backports'
from /usr/local/share/gems/gems/dashing-1.3.7/lib/dashing/app.rb:171:in `block in require_glob'
from /usr/local/share/gems/gems/dashing-1.3.7/lib/dashing/app.rb:170:in `each'
from /usr/local/share/gems/gems/dashing-1.3.7/lib/dashing/app.rb:170:in `require_glob'
from /usr/local/share/gems/gems/dashing-1.3.7/lib/dashing/app.rb:180:in `<top (required)>'
from /usr/local/share/gems/gems/dashing-1.3.7/lib/dashing.rb:3:in `require'
from /usr/local/share/gems/gems/dashing-1.3.7/lib/dashing.rb:3:in `<top (required)>'
from config.ru:1:in `require'
from config.ru:1:in `block in <main>'
from /usr/local/share/gems/gems/rack-1.5.5/lib/rack/builder.rb:55:in `instance_eval'
from /usr/local/share/gems/gems/rack-1.5.5/lib/rack/builder.rb:55:in `initialize'
from config.ru:1:in `new'
from config.ru:1:in `<main>'
from /usr/local/share/gems/gems/thin-1.6.4/lib/rack/adapter/loader.rb:33:in `eval'
from /usr/local/share/gems/gems/thin-1.6.4/lib/rack/adapter/loader.rb:33:in `load'
from /usr/local/share/gems/gems/thin-1.6.4/lib/thin/controllers/controller.rb:182:in `load_rackup_config'
from /usr/local/share/gems/gems/thin-1.6.4/lib/thin/controllers/controller.rb:72:in `start'
from /usr/local/share/gems/gems/thin-1.6.4/lib/thin/runner.rb:200:in `run_command'
from /usr/local/share/gems/gems/thin-1.6.4/lib/thin/runner.rb:156:in `run!'
from /usr/local/share/gems/gems/thin-1.6.4/bin/thin:6:in `<top (required)>'
from /usr/local/bin/thin:23:in `load'
from /usr/local/bin/thin:23:in `<main>'
In the Icinga itself such a condition working fine:
object HostGroup "Test" {
display_name = "Test"
assign where "PROD" in host.groups
}
It takes the global stats from the /v1/status/CIB url endpoint, that’s what is referred to as cib_data. If you want to apply filtered counts to that send_event call, you’ll need to collect and expose such. It isn’t easy but doable with some programming effort. I can only be guiding here, I don’t have time atm to look again into the code and fire up a test setup.