I’m sorry if I missed this somewhere. I looked through the documentation and couldn’t find it.
I’m working on a script I can use to set downtime for a server when it suspends, since I like to do that periodically. I’d like to set downtime and then later remove it, but one thing at a time.
In my reading, it looks like I need to authenticate with a certificate which is why my check is failing:
$ ./ack.sh
{"error":404,"status":"The requested path 'v1/actions/schedule-downtime' could not be found or the request method is not valid for this path."}
The examples I see assume that the ca is in pki/ but my pki folder is empty.
Did I miss a step during api setup? I’ve always been bad with ssl related stuff
I just tried it, not to completion and it said: Certificate '/var/lib/icinga2/certs//ohm.lan.crt' for CN 'ohm.lan' already existing. Skipping certificate generation.
So I now found it in /var/lib/icinga2
I don’t really want to run the node wizard to completion because I’m afraid I’ll blow away something else I have configured already… Is that not an issue?
Let me see if I can get it to work with the ca in /var/lib/icinga2
Thanks for the permission but seriously thanks for making sure other people do that.
[root@ohm:~] # icinga2 -V
icinga2 - The Icinga 2 network monitoring daemon (version: r2.13.6-1)
Copyright (c) 2012-2024 Icinga GmbH (https://icinga.com/)
License GPLv2+: GNU GPL version 2 or later <https://gnu.org/licenses/gpl2.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
System information:
Platform: Raspbian GNU/Linux
Platform version: 12 (bookworm)
Kernel: Linux
Kernel version: 6.1.21-v7+
Architecture: armv7l
Build information:
Compiler: GNU 12.2.0
Build host: test2019
OpenSSL version: OpenSSL 3.0.13 30 Jan 2024
Application information:
General paths:
Config directory: /etc/icinga2
Data directory: /var/lib/icinga2
Log directory: /var/log/icinga2
Cache directory: /var/cache/icinga2
Spool directory: /var/spool/icinga2
Run directory: /run/icinga2
Old paths (deprecated):
Installation root: /usr
Sysconf directory: /etc
Run directory (base): /run
Local state directory: /var
Internal paths:
Package data directory: /usr/share/icinga2
State path: /var/lib/icinga2/icinga2.state
Modified attributes path: /var/lib/icinga2/modified-attributes.conf
Objects path: /var/cache/icinga2/icinga2.debug
Vars path: /var/cache/icinga2/icinga2.vars
PID path: /run/icinga2/icinga2.pid
[root@ohm:~] # cat /etc/icinga2/features-enabled/api.conf
/**
* The API listener is used for distributed monitoring setups.
*/
object ApiListener "api" {
ticket_salt = TicketSalt
}
[root@ohm:~] # cat /etc/icinga2/conf.d/api-users.conf
/**
* The ApiUser objects are used for authentication against the API.
*/
object ApiUser "root" {
password = "password"
// client_cn = ""
permissions = [ "*" ]
}
Just for your information, on Raspberry Pi OS you can follow Icinga 2’s Debian installation instructions and get the latest Icinga 2 version, as the version from the distribution packages, 2.13.6-2+deb12u1, is a bit older.
Please just be sure to follow the Debian installation, not the Raspbian ones, which are outdated and to be removed: