Get latest version of SMART's scripts with URL

This commit is contained in:
Jeremy Gardais 2020-03-05 15:23:29 +01:00
parent 0eaf0e8f6f
commit 7eaac7e803
4 changed files with 40 additions and 4 deletions

View File

@ -1,3 +1,8 @@
## v1.x.y
### Enhancements
* Possibility to define URLs in order to get the latest version of SMART's scripts.
## v1.4.0 ## v1.4.0
### Enhancements ### Enhancements

View File

@ -106,6 +106,7 @@ For more features, see the next Smart plugin.
* **xymon_cli__plug_smartoverall_package**: The packages to install to provide `smartoverall` plugin [default: `[ 'smartmontools' ]`]. * **xymon_cli__plug_smartoverall_package**: The packages to install to provide `smartoverall` plugin [default: `[ 'smartmontools' ]`].
* **xymon_cli__plug_smartoverall_script_path**: Path to the `smartoverall` script [default: `'/usr/lib/xymon/client/ext/smartoverall'`]. * **xymon_cli__plug_smartoverall_script_path**: Path to the `smartoverall` script [default: `'/usr/lib/xymon/client/ext/smartoverall'`].
* **xymon_cli__plug_smartoverall_script_tpl**: Template used to generate the previous script [default: `'usr/lib/xymon/client/ext/smartoverall.j2'`]. * **xymon_cli__plug_smartoverall_script_tpl**: Template used to generate the previous script [default: `'usr/lib/xymon/client/ext/smartoverall.j2'`].
* **xymon_cli__plug_smartoverall_script_url**: Use a remote file to get the previous script instead of a template [default: `''`].
* **xymon_cli__plug_smartoverall_path**: Configuration file for the `smartoverall` plugin [default: `'/etc/xymon/clientlaunch.d/smartoverall.cfg'`]. * **xymon_cli__plug_smartoverall_path**: Configuration file for the `smartoverall` plugin [default: `'/etc/xymon/clientlaunch.d/smartoverall.cfg'`].
* **xymon_cli__plug_smartoverall_tpl**: Template used to generate the previous config file [default: `'etc/xymon/clientlaunch.d/smartoverall.cfg.j2'`]. * **xymon_cli__plug_smartoverall_tpl**: Template used to generate the previous config file [default: `'etc/xymon/clientlaunch.d/smartoverall.cfg.j2'`].
* **xymon_cli__plug_smartoverall_interval**: Time between each run of the `smartoverall` plugin [default: `'10m'`] * **xymon_cli__plug_smartoverall_interval**: Time between each run of the `smartoverall` plugin [default: `'10m'`]
@ -120,6 +121,7 @@ one's recommended by the vendor and check a recent (<24h) test was done.
* **xymon_cli__plug_smart_package**: The packages to install to provide `smart` plugin [default: `[ 'smartmontools' ]`]. * **xymon_cli__plug_smart_package**: The packages to install to provide `smart` plugin [default: `[ 'smartmontools' ]`].
* **xymon_cli__plug_smart_script_path**: Path to the `smart` script [default: `'/usr/lib/xymon/client/ext/smart'`]. * **xymon_cli__plug_smart_script_path**: Path to the `smart` script [default: `'/usr/lib/xymon/client/ext/smart'`].
* **xymon_cli__plug_smart_script_tpl**: Template used to generate the previous script [default: `'usr/lib/xymon/client/ext/smart.j2'`]. * **xymon_cli__plug_smart_script_tpl**: Template used to generate the previous script [default: `'usr/lib/xymon/client/ext/smart.j2'`].
* **xymon_cli__plug_smart_script_url**: Use a remote file to get the previous script instead of a template [default: `''`].
* **xymon_cli__plug_smart_path**: Configuration file for the `smart` plugin [default: `'/etc/xymon/clientlaunch.d/smart.cfg'`]. * **xymon_cli__plug_smart_path**: Configuration file for the `smart` plugin [default: `'/etc/xymon/clientlaunch.d/smart.cfg'`].
* **xymon_cli__plug_smart_tpl**: Template used to generate the previous config file [default: `'etc/xymon/clientlaunch.d/smart.cfg.j2'`]. * **xymon_cli__plug_smart_tpl**: Template used to generate the previous config file [default: `'etc/xymon/clientlaunch.d/smart.cfg.j2'`].
* **xymon_cli__plug_smart_interval**: Time between each run of the `smart` plugin [default: `'10m'`] * **xymon_cli__plug_smart_interval**: Time between each run of the `smart` plugin [default: `'10m'`]

View File

@ -114,6 +114,7 @@ xymon_cli__plug_smartoverall_state: False
xymon_cli__plug_smartoverall_package: [ 'smartmontools' ] xymon_cli__plug_smartoverall_package: [ 'smartmontools' ]
xymon_cli__plug_smartoverall_script_path: '/usr/lib/xymon/client/ext/smartoverall' xymon_cli__plug_smartoverall_script_path: '/usr/lib/xymon/client/ext/smartoverall'
xymon_cli__plug_smartoverall_script_tpl: 'usr/lib/xymon/client/ext/smartoverall.j2' xymon_cli__plug_smartoverall_script_tpl: 'usr/lib/xymon/client/ext/smartoverall.j2'
xymon_cli__plug_smartoverall_script_url: ''
xymon_cli__plug_smartoverall_path: '/etc/xymon/clientlaunch.d/smartoverall.cfg' xymon_cli__plug_smartoverall_path: '/etc/xymon/clientlaunch.d/smartoverall.cfg'
xymon_cli__plug_smartoverall_tpl: 'etc/xymon/clientlaunch.d/smartoverall.cfg.j2' xymon_cli__plug_smartoverall_tpl: 'etc/xymon/clientlaunch.d/smartoverall.cfg.j2'
xymon_cli__plug_smartoverall_interval: '10m' xymon_cli__plug_smartoverall_interval: '10m'
@ -125,6 +126,7 @@ xymon_cli__plug_smart_state: False
xymon_cli__plug_smart_package: [ 'smartmontools' ] xymon_cli__plug_smart_package: [ 'smartmontools' ]
xymon_cli__plug_smart_script_path: '/usr/lib/xymon/client/ext/smart' xymon_cli__plug_smart_script_path: '/usr/lib/xymon/client/ext/smart'
xymon_cli__plug_smart_script_tpl: 'usr/lib/xymon/client/ext/smart.j2' xymon_cli__plug_smart_script_tpl: 'usr/lib/xymon/client/ext/smart.j2'
xymon_cli__plug_smart_script_url: ''
xymon_cli__plug_smart_path: '/etc/xymon/clientlaunch.d/smart.cfg' xymon_cli__plug_smart_path: '/etc/xymon/clientlaunch.d/smart.cfg'
xymon_cli__plug_smart_tpl: 'etc/xymon/clientlaunch.d/smart.cfg.j2' xymon_cli__plug_smart_tpl: 'etc/xymon/clientlaunch.d/smart.cfg.j2'
xymon_cli__plug_smart_interval: '10m' xymon_cli__plug_smart_interval: '10m'

View File

@ -222,7 +222,7 @@
xymon_plug_manage|bool) xymon_plug_manage|bool)
notify: restart xymon-client service notify: restart xymon-client service
- name: PLUGIN smartoverall script file - name: PLUGIN smartoverall script file from template
template: template:
src: '{{ xymon_cli__plug_smartoverall_script_tpl }}' src: '{{ xymon_cli__plug_smartoverall_script_tpl }}'
dest: '{{ xymon_cli__plug_smartoverall_script_path }}' dest: '{{ xymon_cli__plug_smartoverall_script_path }}'
@ -230,7 +230,20 @@
group: xymon group: xymon
mode: 0755 mode: 0755
when: (xymon_cli_manage|bool and when: (xymon_cli_manage|bool and
xymon_plug_manage|bool) xymon_plug_manage|bool and
xymon_cli__plug_smartoverall_script_url|length == 0 )
notify: restart xymon-client service
- name: PLUGIN smartoverall script file from URL
get_url:
url: '{{ xymon_cli__plug_smartoverall_script_url }}'
dest: '{{ xymon_cli__plug_smartoverall_script_path }}'
owner: root
group: xymon
mode: 0755
when: (xymon_cli_manage|bool and
xymon_plug_manage|bool and
xymon_cli__plug_smartoverall_script_url|length > 0 )
notify: restart xymon-client service notify: restart xymon-client service
# Manage smart plugin [[[1 # Manage smart plugin [[[1
@ -258,7 +271,7 @@
xymon_plug_manage|bool) xymon_plug_manage|bool)
notify: restart xymon-client service notify: restart xymon-client service
- name: PLUGIN smart script file - name: PLUGIN smart script file from template
template: template:
src: '{{ xymon_cli__plug_smart_script_tpl }}' src: '{{ xymon_cli__plug_smart_script_tpl }}'
dest: '{{ xymon_cli__plug_smart_script_path }}' dest: '{{ xymon_cli__plug_smart_script_path }}'
@ -266,9 +279,23 @@
group: xymon group: xymon
mode: 0755 mode: 0755
when: (xymon_cli_manage|bool and when: (xymon_cli_manage|bool and
xymon_plug_manage|bool) xymon_plug_manage|bool and
xymon_cli__plug_smart_script_url|length == 0 )
notify: restart xymon-client service notify: restart xymon-client service
- name: PLUGIN smart script file from URL
get_url:
url: '{{ xymon_cli__plug_smart_script_url }}'
dest: '{{ xymon_cli__plug_smart_script_path }}'
owner: root
group: xymon
mode: 0755
when: (xymon_cli_manage|bool and
xymon_plug_manage|bool and
xymon_cli__plug_smart_script_url|length > 0 )
notify: restart xymon-client service
# Manage zfs plugin [[[1 # Manage zfs plugin [[[1
- name: PLUGIN zfs config file - name: PLUGIN zfs config file
template: template: