Question on this module for setting up a service check (NOTE: I’m still playing around with this module)
Is it possible to have a single service to check all nodes of a BP object? Or with how I am currently setup, would I need to create a service definition for each subprocess Node?
The “*” doesn’t work… unsure if I needed to have 1 more level before I start splitting things out into App, DB, OS, Web…etc.
Here is my service definition…
apply Service "Icinga 2 Cluster Status Process" {
import "service-check-alarm-settings"
check_command = "check_business_process"
vars.business_process_config_file = "Icinga2Overview"
vars.business_process_check_node = "*"
vars.business_process_show_details = true
vars.grafana_graph_disable = true
assign where match("icinga*", host.name)
}
I sadly have to report that the most easiest way to achieve what you want is actually not possible with the businessprocess module.
But as always there is a way to work around it
You can use the check_many plugin to aggregate the results of those single businessprocess checks.
You would create checks with the following commandlines which give you the single results:
icingacli businessprocess process check “Database Servers”
icingacli businessprocess process check “Application Servers”
Small addition to check_many because it doesn’t seem obvious …
you need to create a textfile with the single checks in it to use it like:
localhost#: vi test.txt
icingacli businessprocess process check "Database Servers"
icingacli businessprocess process check "Application Servers"
How to initiate the check itself:
localhost#: ./check_many < test.txt
OK All checks OK.|0/2 total checks failed
OK (?): Business Process OK: Database Servers
OK (?): Business Process OK: Application Servers
|-
After this I downed a service and was able to see everything in the check
I had to play with toggles on the AND | OR for each subprocess node.
This allows me to create a single service check
apply Service "Icinga 2 Monitoring App Status" {
import "service-check-alarm-settings"
check_command = "check_business_process"
vars.business_process_config_file = "Icinga2Overview"
vars.business_process_check_node = "Icinga2Root"
vars.business_process_show_details = true
vars.grafana_graph_disable = true
assign where match("icingap*", host.name)
}
[user@icinga02 ~ 2849]$ sudo icingacli businessprocess process check --config Icinga2Overview Icinga2Root --details --colors
Business Process CRITICAL: Icinga2 Root
& [CRITICAL] Database Servers
& [CRITICAL] icinga02 DB
- [CRITICAL] icinga02: MySQL Connect: Databases Connection Time
- [CRITICAL] icinga02: Threads Connected
- [CRITICAL] icinga02: Uptime
Is it possible that the “businessprocess process check” command detects downtimes for Hosts like the Icingaweb2 Businessprocess Plugin does (not full red in GUI)?
/bin/icingacli businessprocess process check bp_windows --details --colors
Business Process CRITICAL: windows
& [CRITICAL] windows 1
- [DOWN] SERVER2020
The Host SERVER2020 is down, but is in Icinga2 Downtime …
Since BP 2.3.0 you can use additional options to suppress ack or downtimed hosts/services.
Additions to ‘icingacli businessprocess process check’:
The check command used to just ignore acknowledgements and downtimes. So we added two new switches that make it possible to set the state to OK, if the node is acknowledged or in downtime.
–ack-is-ok and --downtime-is-ok for setting the respective state to OK.
–blame is for only showing nodes that have the same state as the process itself.
–root-cause --blame shows only the path that causes a problem.