Design question
Posted: Wed Oct 21, 2015 6:06 am
Hello,
I have implemented a set of chains which can automate Windows WSUS installation. At this moment servers that need an update are manually added in a schedule on Nagios Reactor after an alert is triggered from this plugin http://outsideit.net/check-ms-win-updates/. This schedule will start at the configured hour (mostly 00:30), take a snapshot of the server, install the WSUS updates on the server and reboot the server if necessary. The day after the scheudle has to be deasactivated manually, as there is not yet a way in reactor to run a chain once in the future (please tell me if i'm wrong). That's why I made this feature request: http://tracker.nagios.com/view.php?id=747
We would like to create a quick action which can initiate such a Windows update chain during the night. There are many possible ways to do this and I would like your opinion on some of the options.
It is also no yet possible to pass a variable in the popup window of a Reactor quick action, so I can't pass the time we would like the WSUS updates to be installed. Check out this thread where I asked for this feature https://support.nagios.com/forum/viewto ... ctor+popup and Trevot said he would make it for me. (Could I have the id for that pls?)
So then I was thinking to make a quick action which adds the host to a hostgroup. Then I could make a schedule which would every nigh update all WSUS hosts in the hostgroup and the remove the host from the hostgroup. This seemed like a good approach, but has a few disadvantages. As every time a host is added or removed from a hostgroup, an apply is needed and an apply take +- 30 seconds, during which there is a window where we are not seeing or finding any hosts. As we have 500+ Windows servers, the above method would imply too many interruptions in the monitoring.
In the meantime I have added a database to our MSSQL database Nagios_Extensions (which also stores our real-time event id exclusions for NSCLient) to store the Windows hosts which need to be updated. I'm 25 % on the way of finishing a Python script which can read and write hosts in the MSSQL database which contains the hosts. But my Python knowledge is basic and I'm not yet convinced this is the best idea. As I would in time publish this set of chains, I cannot be sure every Nagios XI user has access to MSSQL databases, I think I'm in need of a better option.
Today I read about static configuration files like /usr/local/nagios/etc/static/xiobjects.cfg
The documentation about this is very basic and does not contain enough info for me. Would it be usable in my above setup? Is it necessary to apply configuration when adding and removing hosts from this static configuration file? Could I make a bash script which adds hosts to a hostgroup in this static config file and later use a json query to extract the hosts in that hostgroup? Or are static config files not taken into account in JSON queries?
Is there any other option i'm not seeing I could use. The main requirement would be that I don't need to apply configuration in order to add/ remove hosts to a hostgroup or database table.
Thanks for any input on this.
I have implemented a set of chains which can automate Windows WSUS installation. At this moment servers that need an update are manually added in a schedule on Nagios Reactor after an alert is triggered from this plugin http://outsideit.net/check-ms-win-updates/. This schedule will start at the configured hour (mostly 00:30), take a snapshot of the server, install the WSUS updates on the server and reboot the server if necessary. The day after the scheudle has to be deasactivated manually, as there is not yet a way in reactor to run a chain once in the future (please tell me if i'm wrong). That's why I made this feature request: http://tracker.nagios.com/view.php?id=747
We would like to create a quick action which can initiate such a Windows update chain during the night. There are many possible ways to do this and I would like your opinion on some of the options.
It is also no yet possible to pass a variable in the popup window of a Reactor quick action, so I can't pass the time we would like the WSUS updates to be installed. Check out this thread where I asked for this feature https://support.nagios.com/forum/viewto ... ctor+popup and Trevot said he would make it for me. (Could I have the id for that pls?)
So then I was thinking to make a quick action which adds the host to a hostgroup. Then I could make a schedule which would every nigh update all WSUS hosts in the hostgroup and the remove the host from the hostgroup. This seemed like a good approach, but has a few disadvantages. As every time a host is added or removed from a hostgroup, an apply is needed and an apply take +- 30 seconds, during which there is a window where we are not seeing or finding any hosts. As we have 500+ Windows servers, the above method would imply too many interruptions in the monitoring.
In the meantime I have added a database to our MSSQL database Nagios_Extensions (which also stores our real-time event id exclusions for NSCLient) to store the Windows hosts which need to be updated. I'm 25 % on the way of finishing a Python script which can read and write hosts in the MSSQL database which contains the hosts. But my Python knowledge is basic and I'm not yet convinced this is the best idea. As I would in time publish this set of chains, I cannot be sure every Nagios XI user has access to MSSQL databases, I think I'm in need of a better option.
Today I read about static configuration files like /usr/local/nagios/etc/static/xiobjects.cfg
The documentation about this is very basic and does not contain enough info for me. Would it be usable in my above setup? Is it necessary to apply configuration when adding and removing hosts from this static configuration file? Could I make a bash script which adds hosts to a hostgroup in this static config file and later use a json query to extract the hosts in that hostgroup? Or are static config files not taken into account in JSON queries?
Is there any other option i'm not seeing I could use. The main requirement would be that I don't need to apply configuration in order to add/ remove hosts to a hostgroup or database table.
Thanks for any input on this.