Comparing Microsoft Copilot vs Google Gemini Pro for installing Nagios using Ansible
A comparison between Microsoft Copilot and Google Gemini Pro for generating an Ansible playbook to install Nagios.
I’ve been tinkering with the current generation of AI for a while now. I am amazed by the image generation capabilities of Copilot. I’ve already used generative AI to suggest blog names for my hobby blog and to generate a logo for it as well.
This got me thinking. How good is generative AI at more IT related tasks and what would be a good test?
There is no point in choosing something obscure, so I need something old and well known to give the AI a chance. You can’t get better known than Nagios in the system monitoring space and it is certainly old enough to have garnered plenty of food for the AI to learn from.
My test is going to be installing Nagios on an Ubuntu 22.04 host using Ansible. I chose Ansible because I’m familiar with it and would normally use it to configure a new host.
Test setup
The queries were executed on a Lenovo Thinkpad running Windows 11. The scripts were tested on an old Lenovo Thinkpad X230 running Ubuntu 22.04, Ansible 2.12.10 and LXD hosting the Ubuntu 22.04 container where Nagios is installed.
Ansible
Ansible is a powerful tool for ensuring a host is in an appropriate state. It can install software, create or alter configuration files among many other things.
I have used the query Write an ansible playbook for installing nagios on an ubuntu 22.04 host with both Copilot and Google Gemini Pro.
Microsoft Copilot
I launched the query using the preview Copilot in Windows sidebar installed in Windows 11.
The query produced the Ansible playbook listed below:
|
|
I executed the script as generated by Copilot using the instructions provided. The image below shows the results.
The script failed because when registering the nagios user, the group specified nagcmd
does not exist.
Google Gemini Pro
I launched the query using the Gemini app.
The Ansible playbook generated by Google Gemini is listed below:
|
|
One thing that I immediately notice is that the Nagios version number is hard coded throughout the Gemini generated script. In the Copilot script, the Nagios version is stored in a variable at the top of the script. This makes the Copilot script much easier to maintain when you need to upgrade to a new version of Nagios. Simply go to the top of the script, find the nagios version number variable and enter the desired Nagios version number. With the Gemini script, you have to go through the script and find all of the places that the Nagios version number is used. This makes it very easy to miss one of the references and potentially end up installing either the wrong version number or fail to install any version of Nagios.
The Gemini script also installs the Nagios core plugins and marks them as optional. The Copilot generated script does not mention plugins at all. Which is understandable as my query didn’t mention plugins either. But, given how Nagios is architected, it doesn’t do very much without plugins so kudos to Gemini for installing the core add-ons.
The Gemini output could be improved further by providing an example host file and the instructions how to use it. The Copilot instructions are much easier to follow for a beginner because all of the steps are clearly outlined with examples and sample commands. The Gemini instructions are nearly there but leave out crucial details like an example hosts file and the specific command for executing the playbook using the example hosts file.
I executed the script generated by Gemini and it failed with the error displayed below.
The script is invalid. Kudos to Gemini for creating the nagios group but if you wish to group commands together you need to put them under a block. Another problem is that I can’t find any evidence for a module called apache2ctl
. There is one called community.general.apache2_module
which appears to do the same thing.
Conclusion
I suspect your view of these very capable tools will differ based upon how you are using the tool.
As a sysadmin wishing to learn how to use Ansible, I think you will find either of these tools to be a great aid in helping you learn. Both tools provide further reading at the end of their output. I doubt either tool is going to guide a complete beginner through how to use Ansible to install Nagios. But, if you’ve done some reasearch before then I think these tools will help you a lot in speeding up your existing learning.
If you are a less experienced Ansible user wanting to get things done rather than as a learning tool then you will appreciate how Copilot works.
As an experienced sysadmin these tools are going to help you a lot. I think both tools would be helpful to an experienced Ansible user shortening the time to get a good enough script which can then be tweaked and improved. Where generative AI tools will be invaluable is removing that horrible feeling of starting a project with a blank page. Both these tools provide a starting point that cuts out the blank page and the struggle to get started. I think Copilot on this test provided a particularly good starting point upon which an experience Ansible sysadmin could then improve.
If you think these tools are drop in replacements for a sysadmin, then I think you will be disappointed. Neither of the playbooks worked. If you are expecting a tool that just works first time, you are going to be disappointed. You still need to know what you are doing. The tools will save you some time or they’ll help you learn faster. That’s about as good as this generation of tools is going to be.
If I had to choose between the two, I’d go with Copilot. I think the script is superior as well as the instructions being clearer.
P.S. The post thumbnail was generated by Copilot in answer to the query create an image for a blog post comparing the performance of Copilot vs Google Gemini 😉