*Version: 1.0 | Last Updated: 15/10/2024* ## Overview - **Integration Name:** Nagios - **Purpose:** Fetching data from Nagios to MoovingON AI - **Audience:** DevOps, Support team, TAM - **Prerequisites:** Administrator role in MoovingON AI and Nagios --- ## Table of Contents - [[#Setup Instructions]] - [[#Configuration]] - [[#Related Links]] --- ## Setup Instructions` First, we’ll have to add a new Incoming API Integration: **Navigate to Settings >> Integrations** **![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXe7JbMmY29r72JDKu6wtvtuzVseDKcvkNPlwNiFSHJL50EHYsiQWYuCEBStBguYAbbpwjsyzyyPeU-zmM2JFu1kBEe4G8llr0Zs8ej-VRZkgrGbqJFY9KoOrvtNCpAcqShcY1Q0E0QfbVU4DS2UOFpF1dc?key=YbRGfDJ4v7Ib9v6vjKidKw)** Select the relevant customer, then click Add Webhook, choose a name then Submit **![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdx_6IbRmt7HO7oleDD0FIEVFvZOWEElM-QEHaombHkiY94oMLK0gvxfi3zvvNmWT2mv66VwkpsePiZW4_TUiet4XCmOQRR7D1FWsCtsA-WJmZAb44AiWHbEodZ-m9JTmojxy-Jv_HYLcPmDweHZBrJnz7X?key=YbRGfDJ4v7Ib9v6vjKidKw)** Next, we’ll copy the Username and Password so we’ll be able to use them during Nagios Configuration **![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdftB0KFsctdudQ70rgU0rCtuwFirMXIieZRJF5g8CSVfPwbokdBuDG0BcAOYWS3NApNu0xYPGRtP4SASRVuT9jjNn92sFW9iNDMRJsww8pEpzgWOaUoPJAv9uSGEGDCh_p0JV_?key=KBEKAuRqwRONFDBsNTxVIo1q)** --- ## Configuration **Nagios Configuration:** 1. **Connect to the Nagios XI server by using an SSH client.** 2. **Log in using the root user:** **![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfUNklvpEbCjxVN-YNE-dKs1gjWVlZV7P1uOOShbdN4qCh3hVYz-xkVNGMkQx5S41IHwue5HiQALiW_C900mBzac9HNX_fYBlX1g07L-BGl6w0lFpu8CETOCpvG4WGw67zbezR2xno10Ubc4sKZSvrTtXQH?key=YbRGfDJ4v7Ib9v6vjKidKw)** 3. **Download the latest version of the script:** **![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXe1SO6Nbsup1xDSSLppOaDq22fkgdtIjAf8TRP35wyiBGq_g94fa4sRminFhlizmRwB3wQPpoTBkcm0ZfIk-gk9MZ_MVq5mLD7lRb-lLfDQfPRunvPzQHiKHUXnIR6Q0eKWgtgkLo6jh2jDYJLeYrrV0h2K?key=YbRGfDJ4v7Ib9v6vjKidKw)** 4. **Extract it to Nagios’s libexec directory:** **![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdE7XlY6ZAKNLGvhqZbGil9TdNMQYLnCqm3GpPNboXWoyjhfcKqDRFl9OjZJlyKyUogH9ekdmT7quiksCDm2FRDmwkATYkesCTQbv7XP5MDxGGfuW--6ucs0mqLFH9c0rzmp7iqO6LoYthMDkDSQwO53t8?key=YbRGfDJ4v7Ib9v6vjKidKw)** 5. **Create a config file by making a copy of setting.conf.bak** **![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfTF11H1dsgOcuyDMKs9WG0nzAQZ57wJIfPU0rf5mstmHLM5PI9wBkDs1IDshwTfsbvZcidRXqcDpUyUjWvFNBsZtq-VP2yWqR_6zAA4qeF-opqk9Qn8oqvPff1PKtuJ6o-vKLezPhkLyrIeFC2RpdJJPF4?key=YbRGfDJ4v7Ib9v6vjKidKw)** 6. **Set Nagios user to be the owner of the MoovingON.AI folder and files (it’s essential so Nagios itself will be able to run the script. There’s more information about it in the troubleshooting section).** **![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcajJ6kio7DOIm1GngxpKxy6b-IphvR6aHLT6QUmvV_pML6t0Xj7vzDUOiykrHHr-tdiQblJj3FqHUgkbblFqf1rQztwrvmtMubvp2J8ruMiJ7Pp-K6zo2e5FBhfAYU5kZ9GR3dUghkcaJAoESXV5510O7Q?key=YbRGfDJ4v7Ib9v6vjKidKw)** 7. **Edit the config file and add the Username and Password that we’ve got from MoovingON AI:** **Example:** ** **![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXd-GT1tQAfxYwHEIs8Bc__7aHWsaHS-NuV0tP2BPaT2XtH3YXqlKLBjMlDIImvs8vYUBGkMywVNNtz8wq-qKkiPnElBDEBRsoqZ239sjoRMy6ikucZ5NW4kmjWD-CA2TMqC97JjyA?key=KBEKAuRqwRONFDBsNTxVIo1q)** 8. **We should set push-to-xiteit.sh to run every 15 seconds by using cron:** **(It might be necessary to install Crontab.)** **![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdyfKb7ZWQt2Q-zbe8wajuri_c60N_9fwunhyDssaZlAdSXOpVrOuc3BD0r-Nw1ABkLnRALHraQfBg_b-pRbRMJ2pW0H9gfN80hmiojkDTc627AgtecK6AXITL0BoB6mtKLEkT_ZUEjKopgQcQfFNFw9f4a?key=YbRGfDJ4v7Ib9v6vjKidKw)** Copy the following:** **![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcm8iNh5DKXcx8O5wblXk6_kl-y-Ie4c3uvLDRiT6m0df_PGeJE93qF4f531FRIeDtJemyO0KS5pvVe5Qb3dzPtnljhDzYpAGYeZAIq0q1ayWnomWKQTv8sHaZ4Uh0hdrHjJqUjsYfDiF95UKf5ZTG4Xllj?key=YbRGfDJ4v7Ib9v6vjKidKw)** **And save** 9. **Now we should log in to the web interface of Nagios. Go to Configure >> Core Config Manager** **![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeO_ZzzJz_RljJzQTYwfhpU6hM5og3ycgc-IV44-fvBtFu9jEMDk4DSge-X4hRSKm6mrSb-18EmaClM1xKPIwERovwlxTm8it6rxEiHKsoOYBNOjbLvoAWGgLf6h34tZ31pxe8Yj2qFd7gcHEDSdNP3LMg?key=YbRGfDJ4v7Ib9v6vjKidKw)** 10. **On the menu, click on Commands and then Add New.** **![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcZzIakyExf8COkP3uMEwLK9wadW_Pe7F70qcj6ZmwLHHitMDBFPYoTBBDxwGVX1cfH7nn8FVF6Yb4SaaX177pDgUhC4y7OmSzPqw193Rqnd6nyNMYjfyeYUCTgavwvrwIOWnuYCW-ppMfSVzsC1KXyVmWb?key=YbRGfDJ4v7Ib9v6vjKidKw)** 11. **We will add 2 commands. One for Services and one for Hosts.       For the Service, we’ll copy this to the Command Line field:**       **![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfg0hWnFvaNbogRql9gL7WvKiOQQdiXBCKNiAe8w5Ye-k9zNmNNI3-dSe7NG97JMM1wgCgmkl4JIppGXRJnHieRjqoR1e_O01FTtT6KS0f4RWal-fT4Uh9mEhZxwNOlCm99ZWrNOtMaZmd3lOQPLQotumVV?key=YbRGfDJ4v7Ib9v6vjKidKw)**             **For the Host, we would use this:**       **![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXc-NCjxU2aYPtIb0JGzG76wrCv6YuKfa1PtYxkcRHrnW5cdImGjHGsWDe6SFCeBJdvUML7DgpRgKtyzU5T38LDWEL4w74-gYB4dZdD82TpbnVd8_S9vnt6JCoMie6AsUmmhM_Li6deI_HAvp9q8Kx6rPB8?key=YbRGfDJ4v7Ib9v6vjKidKw)**       **![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcFKWEKRtPoj2V4l-3eNzlQPHSgefwNQkdOLPEoIIM2e3tYn-05RPXBGXNjU5LgBt2YjS48_Tcdbcu2vhcPjjqKph-wHc1J-P_BfI8d8rf9NV74YFv3E2HaCOA6im6NBiYS2klhGLYH5Gryvf-WCtgzkfpY?key=YbRGfDJ4v7Ib9v6vjKidKw)**             12. **To use these commands, we’ll have to assign them to a contact by going to Contacts and clicking on Nagios Admin (Alternatively, we can create a new contact and assign it to specific alerts).** **![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdsQxz-7LzkAuQXrqivVLZ8rsxcSr4sZnl9LxBEljhGd38nQpxbTjX-Oy6Mr08h8xUlhsu_lCQHBTo8auRMKtJeZ8lXY8m--gn8nDgSTEWY_q7YUzjqq5-djNPWkE7GDpd5SbuuxO6kw3Zw2B-H73P4u-Jz?key=YbRGfDJ4v7Ib9v6vjKidKw)** 13. **Switch to the Alert Settings tab, set the following:** **![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeIZXbFOaMuOfyjXVV2QXfiSPFsPz98evokSGzwkarKCXzteWoXtld5eDWByq21nD598cSpi3veu7RM2pRE_xv2jEwdn_rpsVCgSN4Lny2_-KcQq20K9q7U5GOobEd0YlmYCae9P-cxYpIhaTxRfYwiv_jG?key=YbRGfDJ4v7Ib9v6vjKidKw)** **Notification options should be set according to the user's preferences.** 14. **We’ll click on Manage Host Notifications Commands and add our custom add-host-to-queue command to Assigned:** **![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXco-tkBBoYnwVZDWc8KKuTPhCIRGM7TYwZHGBkg2XXmut88whIiaGOsjLcP2crTZH_gvGozxtl7tRpFwJOUvK_VqO2MuoePWE1S49ggwN4igLXVFLQmPSqLm3rkSmuwosVyHMpQQ72qtX3cnd_o7hcM9WIB?key=YbRGfDJ4v7Ib9v6vjKidKw)** **We can click Close afterwards** 15. **Likewise, we’ll click on Manage Service Notification Commands and add our custom add-service-to-queue command to Assigned** 16. **That’s it. Every time a new alert changes severity in Nagios XI, a new event will pop up on MoovingON AI** #### Recovery **Nagios alerts with severity OK will not get recovered by default unless we do the following steps:** 1. **Go to Settings >> Templates** 2. **Select the default template that we’ve made when we added an Incoming API integration.****Select the default template that we’ve made when we added an Incoming API integration.** 3. **Click on Fields and set the Recovery field to fetch from severity that contains “OK”** **![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXdJa7Zznn1socX_xgWnVaeluuuZrgPDvhBSdXFH6GAmvF2aeDWYM4Px_XqXVVMWs3gyoGQHXYKD3jL5qdmBA4UHMxCe7Mw4ZID1D_a3iEli1eL4vuqDeCdGzAqk8fN0-BqeFVxBLrK8SV36Q5QuIuZUl80M?key=YbRGfDJ4v7Ib9v6vjKidKw)** **We can now click the save button.** --- ## Related Links - **Internal Links:** [[06.08 Templating]], [[04.15 Webhook]] - **External Resources:** [Nagios Documentation](https://www.nagios.org/documentation/)