-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
winPB: Install NSClient++ On Windows Hosts For Nagios Monitoring (#2827)
* Add new Ansible role Install NSClient, and include the nagios server variables. * Include new NSClient role. * Fix typo in new nsclient role name * Temp Disable Cuda * Fix type on ansible_architecture var name * Debug NSClient Tasks * Temp Changes For Debugging. * Debugging * Correct typo in ansible architecture * Debug MSI Installer Hanging Issue * Fix Install task to use win_package * Remove debugging. * Undo all debugs except for CUDA * RE-enable cuda * Remove redundant variable.
- Loading branch information
1 parent
6e8f3d7
commit c5cbed1
Showing
3 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
ansible/playbooks/AdoptOpenJDK_Windows_Playbook/roles/NSClient/tasks/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
#################################### | ||
# NSCLient++ - Used For Nagios # | ||
#################################### | ||
|
||
- name: Test if NSClient++ is already installed | ||
win_stat: | ||
path: 'c:\nsclient\nscp.exe' | ||
register: nsclient_installed | ||
tags: NSClient | ||
|
||
- name: Download NSClient installer (64-Bit) | ||
win_get_url: | ||
url: https://github.com/mickem/nscp/releases/download/0.5.2.39/NSCP-0.5.2.39-x64.msi | ||
dest: 'C:\temp\nscp.msi' | ||
force: no | ||
checksum: dfe93c293f30586b02510d8b7884e4e177b93a5fead8b5dc6de8103532e6e159 | ||
checksum_algorithm: sha256 | ||
when: (not nsclient_installed.stat.exists) and (ansible_architecture == "64-bit") | ||
tags: NSClient | ||
|
||
- name: Download NSClient installer (32-Bit) | ||
win_get_url: | ||
url: https://github.com/mickem/nscp/releases/download/0.5.2.39/NSCP-0.5.2.39-Win32.msi | ||
dest: 'C:\temp\nscp.msi' | ||
force: no | ||
checksum: ca6a67fb01c1468f2b510fd2f9eb0750887db3fb49a0302732c1421c85c6627c | ||
checksum_algorithm: sha256 | ||
when: (not nsclient_installed.stat.exists) and (ansible_architecture == "32-bit") | ||
tags: NSClient | ||
|
||
- name: Install NSClient | ||
win_package: | ||
path: 'C:\temp\nscp.msi' | ||
creates_path: 'c:\nsclient\nscp.exe' | ||
state: present | ||
arguments: /l* C:\temp\nscp.log /quiet INSTALLLOCATION=c:\nsclient CONF_CAN_CHANGE=1 MONITORING_TOOL=none ALLOWED_HOSTS=127.0.0.1,{{ Nagios_Master_IP }} ADD_DEFAULTS=1 CONF_CHECKS=1 CONF_NSCLIENT=1 /quiet | ||
when: (not nsclient_installed.stat.exists) | ||
tags: NSClient | ||
|
||
- name: Enable External Script Options For NSClient | ||
raw: c:\nsclient\nscp settings --activate-module {{ item }} | ||
with_items: | ||
- CheckExternalScripts | ||
- CheckHelpers | ||
- CheckEventLog | ||
- CheckNSCP | ||
- CheckDisk | ||
- CheckSystem | ||
when: (not nsclient_installed.stat.exists) | ||
register: result | ||
failed_when: (result.rc == 0) or (result.rc == -1) | ||
tags: NSClient | ||
|
||
- name: NSClient - Restart Service | ||
win_service: | ||
name: nscp | ||
state: restarted | ||
tags: NSClient | ||
|
||
- name: Cleanup NSClient | ||
win_file: | ||
path: C:\temp\nscp.msi | ||
state: absent | ||
failed_when: false | ||
tags: NSClient |