Using ChatGPT + Icinga?

by | Jan 25, 2023

The news have been full of coverage: ChatGPT (Generative Pre-trained Transformer), the prototype chatbot released by OpenAI in November 2022 seems to hail in a new era of information sourcing, schooling and learning, and interacting with a computer. The service sprinted to one million users in five days after the launch, with many more following until this date. Many people have tried many things so far – from answering emails and engaging in light conversation to solving homework and generating articles for web portals up until code generation on a bigger scale for websites and small projects have all been generated with a human style conversational prompt.

The implications are far reaching and we can’t say for sure how a tool like this will play out in our world – is talking to computers the future for humanity? a lot of things can be – and have been! – said about this topic, but this isn’t what this blogpost is about.

No, I wanted to find out if ChatGPT can help me setup and run Icinga without any issues!

 

Instruct Me Installing Icinga

So I opened up ChatGPT and started a new conversation. I asked a simple and straightforward question:

Can you tell me how to install Icinga2 and Icingaweb2?

This is the answer I’ve gotten:

Icinga2 and Icingaweb2 can be installed on various operating systems, 
including Linux, Windows, and macOS. 
Here is an example of how to install them on a Debian or Ubuntu system:
  1. Add the Icinga repository to your system by running the following command:
    echo 'deb http://packages.icinga.com/debian icinga-buster main' > /etc/apt/sources.list.d/icinga.list
  2. Import the GPG key for the repository by running:
    wget -O - https://packages.icinga.com/icinga.key | apt-key add -
  3. Update your package lists by running:
    apt-get update
  4. Install Icinga2 by running:
    apt-get install icinga2
  5. Install Icingaweb2 by running:
    apt-get install icingaweb2
  6. Configure Icingaweb2 by running the setup wizard:
    icingacli setup config directory
Note that these are just examples, you may want to check the official documentation for more detail

https://icinga.com/docs/icinga2/latest/doc/01-about/

First of all, I admit that my prompt was very simple and should’ve included an operating system at the very least. Linking to our official documentation is also a nice touch. It’s clear this answer has some issues beyond that too, though.

Before I try to implement these instructions, I wanted to test if giving a specific operating system in the prompt will lead to different – operating system specific – instructions. Even though ChatGPT answered with instructions supposedly applicable for a Debian or Ubuntu based system, it is pretty clear from the first instruction that these instructions are based on Debian 10 (Buster).

Can you tell me how to install Icinga2 and Icingaweb2 on Debian 11?

The answer:

Yes, here is an example of how to install Icinga2 and Icingaweb2 on Debian 11:
  1. Add the Icinga repository to your system by running the following command:

    echo 'deb http://packages.icinga.com/debian icinga-bullseye main' > /etc/apt/sources.list.d/icinga.list

    [...]

Asking for Debian 11 (Bullseye) specifically was processed by ChatGPT, as we can tell from the difference in the two first instructions.

But now, let’s try the first set of instructions on a Debian 10 system, and see how sucessful we are!

echo 'deb http://packages.icinga.com/debian icinga-buster main' > /etc/apt/sources.list.d/icinga.list

So far, no complaints by the terminal.

wget -O - https://packages.icinga.com/icinga.key | apt-key add -

E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation

So this is an issue – and a honest mistake from my point of view. We do mention in our docs that gnupg should be installed beforehand – so I’ll just use the instruction from our documentation to install the required gnupg:

apt-get -y install apt-transport-https wget gnupg

After this, the rest of the instructions worked like a charm. But is Icinga now running on my Debian 10 system? What do I do to find out?

Installation Verification

Well, let’s ask the machine again!

How do I verify that Icinga2 is installed correctly on Debian 10 after a fresh install?

The reply:

After installing Icinga2 on Debian 10, you can verify that it is installed correctly by performing the following steps:

  1. Check the status of the Icinga2 service by running:
    systemctl status icinga2 This command should return the status of the Icinga2 service, and it should say that it is "active (running)".
  2. Check the configuration files for errors by running:
    icinga2 daemon -C This command will check all the configuration files for errors and will display any issues it finds.
  3. Test the connection to the Icinga2 API by running: 
    icinga2 api setup This command will test the connection to the Icinga2 API and will display the version of Icinga2 if successful.
  4. Check the Icinga2 log files by running: 
    tail -f /var/log/icinga2/icinga2.log This command will display the last few lines of the Icinga2 log file and will display new log entries as they happen.
  5. Check if the Icinga2 web interface is working by opening a web browser and navigating to:

    http://your-server-ip/icinga2-web

You can also check the official documentation for more information on how to verify the installation of Icinga2

https://icinga.com/docs/icinga2/latest/doc/01-about/

Please note that this process may vary depending on the specific version and configuration of your Icinga2 installation.

I won’t go over every single one of those instructions, but there is some good stuff in there! icinga2 daemon -C and systemctl status icinga2 probably would’ve been my choices as well.

At the end of the reply from ChatGPT, instruction number 5 is a big tell. ChatGPT seems to be confusing Icinga2 and Icingaweb2 a little bit and mixing them up – or rather, it has no concept of Icinga or Icingaweb.

Conclusion

We’re not quite there yet, but we’ve come a long way. I was very impressed by ChatGPTs capabilities and its ability to give me a half decent set of instructions for installing Icinga and Icingaweb2, but there are still quite a few issues with wording and the explanation of things in specific spots. The future of fully automated bot based monitoring systems might be just around the corner, but for now, the human input to Icinga will probably be necessary for a while to come.

You May Also Like…

Icinga Camp Berlin 2023

It’s time to spread some monitoring love! We’re super happy to announce our next Icinga Camp in Berlin, on May 17th, 2023

Docker: ARMed with PIes

Docker: ARMed with PIes

More and more people use machines with the energy-efficient ARM chips. No wonder, after all the Raspberry Pi's...

Subscribe to our Newsletter

A monthly digest of the latest Icinga news, releases, articles and community topics.