Comments (7)
I have also tried to use a host group, but it returns no result even though it works on the curl
puts "Host listing: " + host_stats.to_s
hostFilter = "host.groups==\"API\""
from dashing-icinga2.
I have also tried this
serviceFilter = [ "service.state==state && match(pattern,service.name)", "filter_vars": { "state": 2, "pattern": "*API*" } ]
from dashing-icinga2.
Hey Ben,
from what I gathered, you want a widget showing a list of all host problems, is that right? You could do something like this:
./dashboards/icinga2.erb
[...]
<li data-row="3" data-col="1" data-sizex="2" data-sizey="2">
<div data-id="icinga-host-severity" data-view="List" data-unordered="true" data-title="Problems"></div>
</li>
This goes within the huge SCHEDULER
loop, basically wherever you want:
./jobs/icinga2.rb
[...]
# host problems
host_severity_stats = []
icinga.getHostObjects().each do |host|
if host['attrs']['groups'].include? 'dummy-hosts'
name = host['attrs']['__name']
state = host['attrs']['state']
host_severity_stats.push({
"label" => name,
"color" => icinga.stateToColor(state.to_int, false),
"state" => state.to_int
})
end
end
order = [ 2,1,3 ]
host_result = host_severity_stats.sort do |a, b|
order.index(a['state'].to_int) <=> order.index(b['state'].to_int)
end
send_event('icinga-host-severity', {
items: host_result,
color: 'blue'
})
[...]
This example will display all non-OK
host states of hosts within the group dummy-hosts
.
Does this help?
from dashing-icinga2.
Thank you for the response. Very helpful to see how you did this... However, I have tried using this to substitute my own HostGroup instead of 'dummy-hosts' and it does not seem to limit to just that group.
It's still displaying service issues from all hosts. The actual hostgroup is defined in groups.conf and it loads correctly in Icinga2web with this filter:
/monitoring/list/hosts?hostgroup_name=mainnet-hosts&sort=host_severity&limit=50
from dashing-icinga2.
Sorry for the long delay, would you mind sharing your edited jobs/icinga2.rb
and dashboards/icinga2.erb
?
from dashing-icinga2.
Not a problem, thanks for the reply. Here are the files:
jobs/icinga2.rb
dashboards/icinga2.erb
from dashing-icinga2.
Seems like you never actually use the data you prepare in your jobs/icinga2.rb
- for this you'd need to rename the data-id
property of one of the widgets of type List
to point to icinga-host-severity
(as you named the data being pushed by the backend job like this) in your dashboards/icinga2.erb
.
You might have to rearrange/uncomment some of the widgets, too. Let me know if I can be of further help.
from dashing-icinga2.
Related Issues (20)
- Object not found! Error in Last two panel HOT 7
- Host and Service Problems still 0 HOT 1
- cookies problem on CHROME HOT 8
- Very Long Delay Behind MS App Proxy before Data Shown HOT 11
- Maintainer wanted HOT 9
- I can't set TZ (TimeZone) for container HOT 3
- No information is shown until service is restarted HOT 17
- No data on icinga2-Dashboard HOT 4
- Question: Change data-sizey lower than 1? HOT 2
- Empty Icinga2-Dashboard HOT 2
- [Bug] Receiving 401 errors after Installation HOT 17
- [Bug] DOWN Hosts are not displayed correctly and throw errors: "no implicit conversion of nil into string" HOT 2
- Invalid yield in layout.erb HOT 3
- Multiple Services for single Host with same name are not displayed individually HOT 1
- Pie-chart widgets render too big HOT 1
- sharing dashboards HOT 3
- Restart-Dashing script does not work ubuntu HOT 2
- Disable roundchart animation HOT 3
- Can't get dashing-icinga2 to work HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dashing-icinga2.