Skip to content

Commit 8a1f18a

Browse files
add disk space check for /home/jenkins in AIX hosts (#2789)
* add disk space check for /home/jenkins in AIX hosts * Reduced duplication and made the machine specific configuration changes generic * rephrased the earlier commit made Co-authored-by: Scott Fryer <[email protected]>
1 parent f4e71b2 commit 8a1f18a

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

ansible/playbooks/nagios/README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,45 @@ The Encrypted File Can Have Its Password Changed With The Following command
5757

5858
2) Either directly on the nagios server host (ansible must be installed), or alternatively from an ansible machine with connection to the nagios server to be.
5959

60-
ansible-playbook -b play_setup_server.yml --ask-vault-pass
60+
ansible-playbook -b play_setup_server.yml --ask-vault-pass
61+
3) For Windows users getting this error when trying to run the playbook
62+
```bash
63+
[WARNING]: Ansible is being run in a world writable directory (/vagrant), ignoring it as an ansible.cfg source
64+
```
65+
edit your Vagrantfile and add
66+
`, id: "vagrant-root", disabled: false, mount_options: ["dmode=775"]`
67+
to the `nagios_server.vm.synced_folder ".", "/vagrant"` line
6168

6269
Based off the [installation guide](https://support.nagios.com/kb/article/nagios-core-installing-nagios-core-from-source-96.html):
6370
And Off This [GitRepo](https://github.com/Willsparker/AnsibleBoilerPlates/tree/main/Nagios) :
6471
For some useful tips for working with vault files see [here](https://docs.ansible.com/ansible/latest/user_guide/vault.html)
6572

73+
add_disk_space_check
74+
## How to add additional disk space check for /home/jenkins on AIX hosts.
75+
76+
Additional checks are defined and added to host specific config files (located in the /usr/local/nagios/etc/servers directory) in the Nagios monitoring server. The steps include :
77+
78+
1) Define the command in the commands.cfg file located at /usr/local/nagios/etc/objects/commands.cfg :
79+
```bash
80+
# 'check_jenkins_disk' command definition
81+
define command{
82+
command_name check_jenkins_disk
83+
command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
84+
}
85+
```
86+
2) Amend the machine specific config file, e.g ( /usr/local/nagios/etc/servers/build-osuosl-aix71-ppc64-1.cfg ) to include the entry for the new check.
87+
88+
```bash
89+
define service {
90+
use generic-service
91+
host_name AIX host name goes here
92+
service_description Disk Space check for Jenkins
93+
check_command check_by_ssh!/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /home/jenkins
94+
check_interval 60
95+
}
96+
```
97+
The second step above is repeated for all AIX hosts in the /usr/local/nagios/etc/servers directory.
98+
6699
### How to update a host group name to the nagios core configurations
67100

68101
* The hostgroups.cfg can be located at
@@ -131,3 +164,4 @@ define host {
131164
```bash
132165
/etc/init.d/nagios reload
133166
```
167+
master

0 commit comments

Comments
 (0)