Page 1 of 1

Auto import dynamic TXT file

Posted: Mon Apr 29, 2019 6:01 am
by nagchef
Hello guys,
i want to auto-import a TXT/CSV file with different IP-Adresses periodical (e.g. 1 time per day) and my Nagios XI then should Ping them... (and delete old IPs which are no longer part of the file).
This is, because the IPs can change very often and the simple way is to change this file.

Is there a way to realize it?
Thanks!

Re: Auto import dynamic TXT file

Posted: Mon Apr 29, 2019 11:37 am
by npolovenko
Hello, @nagchef. If you put host definitions in the /usr/local/nagios/etc/static/ folder they will not be added to the CCM or imported in the database but hosts will display directly on the home page.
So if you write a script that will dynamically update IP address of a host in the host config located in the static folder and then restart the nagios service, you will achieve what you want.

But the easiest way, in my opinion, is to use the API PUT command to update IP addresses of existing hosts.
Untitled.png

Re: Auto import dynamic TXT file

Posted: Thu May 02, 2019 3:37 am
by nagchef
Thanks a lot @npolovenko
:mrgreen:

Re: Auto import dynamic TXT file

Posted: Thu May 02, 2019 11:26 am
by npolovenko
@nagchef, No problem. Are we good to close this thread as resolved?