What is the output of jo within the code proposed in the Icinga2 documentation?

Hi,

I want to do exactly what is documented in Icinga2 Api - Icinga 2 - Schedule Host Downtime(s) with all Services but the code snippet uses a tool (jo) that is not present on my RHEL servers (and installation would be quite a cumbersome administrative process).

Could anyone tell me what this jo utility ( jo man | Linux Command Library) is doing on the code snippet provided, and how to work around its absence? The output of the following command would be very useful to me:

jo -p pretty=true type=Host filter="match(\"*satellite*\", host.name)" \
all_services=true author=icingaadmin \
comment="Cluster upgrade maintenance" fixed=true \
start_time=$(date +%s -d "+0 hour") end_time=$(date +%s -d "+1 hour")

Thank you,

Jean

I writes json for you. so the output is this:

{
   "pretty": true,
   "type": "Host",
   "filter": "match(\"*satellite*\", host.name)",
   "all_services": true,
   "author": "icingaadmin",
   "comment": "Cluster upgrade maintenance",
   "fixed": true,
   "start_time": 1725466996,
   "end_time": 1725470596
}

such a tool outputs correctly formated json so you do not have to escape incompatible parts yourself

2 Likes