From e2b478a1c273a788ea477b0f713c2b20e60d131d Mon Sep 17 00:00:00 2001 From: Mark Nellemann Date: Mon, 23 Aug 2021 11:07:07 +0200 Subject: [PATCH] Ansible playbook for easy install on AIX, and dependency updates. --- build.gradle | 2 +- client/build.gradle | 2 +- .../sysmon/client/ClientRouteBuilder.java | 1 + doc/ansible/sysmon-client-aix.yml | 48 +++++++++++++++++++ doc/ansible/timezone-aix.yml | 35 ++++++++++++++ gradle.properties | 4 +- plugins/build.gradle | 2 +- plugins/os-base/gradle.properties | 2 - plugins/os-ibmi/gradle.properties | 2 - server/build.gradle | 2 +- shared/build.gradle | 6 +-- 11 files changed, 93 insertions(+), 13 deletions(-) create mode 100644 doc/ansible/sysmon-client-aix.yml create mode 100644 doc/ansible/timezone-aix.yml diff --git a/build.gradle b/build.gradle index 77fdee7..00ac202 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ subprojects { maven { url("https://plugins.gradle.org/m2/") } } dependencies { - classpath 'org.redline-rpm:redline:1.2.9' + classpath 'org.redline-rpm:redline:1.2.10' } } diff --git a/client/build.gradle b/client/build.gradle index 5b6a03e..2f4edf6 100644 --- a/client/build.gradle +++ b/client/build.gradle @@ -5,7 +5,7 @@ plugins { id "com.github.johnrengelman.shadow" version "7.0.0" id "net.nemerosa.versioning" version "2.14.0" - id "nebula.ospackage" version "8.5.6" + id "nebula.ospackage" version "8.6.1" } dependencies { diff --git a/client/src/main/java/sysmon/client/ClientRouteBuilder.java b/client/src/main/java/sysmon/client/ClientRouteBuilder.java index 1d1df3e..ec3d62e 100644 --- a/client/src/main/java/sysmon/client/ClientRouteBuilder.java +++ b/client/src/main/java/sysmon/client/ClientRouteBuilder.java @@ -82,4 +82,5 @@ public class ClientRouteBuilder extends RouteBuilder { } + } diff --git a/doc/ansible/sysmon-client-aix.yml b/doc/ansible/sysmon-client-aix.yml new file mode 100644 index 0000000..db784e0 --- /dev/null +++ b/doc/ansible/sysmon-client-aix.yml @@ -0,0 +1,48 @@ +--- +# +# Example ansible playbook for installation of sysmon client on AIX. +# +# ansible-galaxy collection install community.general +# ansible-playbook -i aixhost, -k -u root sysmon-client.yml +# +# NOTE: Ensure correct timezone and time + +- name: "Install / Configure sysmon client and plugins" + hosts: all + gather_facts: yes + vars: + client_download_url: https://bitbucket.org/mnellemann/sysmon/downloads/sysmon-client-0.0.5-1.noarch.rpm + plugins_download_url: https://bitbucket.org/mnellemann/sysmon/downloads/sysmon-plugins-0.0.5-1.noarch.rpm + server_url: http://sysmon-server:9925/metrics + client_hostname: myaix + + tasks: + + - name: Download sysmon-client + get_url: + url: "{{ client_download_url }}" + dest: /opt/sysmon-client.rpm + + - name: Download sysmon-plugins + get_url: + url: "{{ plugins_download_url }}" + dest: /opt/sysmon-plugins.rpm + + - name: Install sysmon-client (if /opt/sysmon/client does not exist) + ansible.builtin.command: /usr/bin/rpm -i --ignoreos /opt/sysmon-client.rpm + args: + creates: /opt/sysmon/client + + - name: Install sysmon-plugins (if /opt/sysmon/plugins does not exist) + ansible.builtin.command: /usr/bin/rpm -i --ignoreos /opt/sysmon-plugins.rpm + args: + creates: /opt/sysmon/plugins + + - name: Create inittab entry for sysmon-client + community.general.aix_inittab: + name: sysmon + runlevel: '2' + action: respawn + command: env JAVA_HOME=/usr/java8_64 /opt/sysmon/client/bin/client -s {{ server_url }} -n {{ client_hostname }} >/tmp/sysmon.log 2>&1 + state: present + become: yes \ No newline at end of file diff --git a/doc/ansible/timezone-aix.yml b/doc/ansible/timezone-aix.yml new file mode 100644 index 0000000..4dfde67 --- /dev/null +++ b/doc/ansible/timezone-aix.yml @@ -0,0 +1,35 @@ +--- +# +# Example ansible playbook for timezone and NTP setup on AIX. +# A reboot is required for the timezone change. +# +# ansible-galaxy collection install community.general +# ansible-playbook -i aixhost, -k -u root timezone-aix.yml +# + +- name: "Install / Configure sysmon client and plugins" + hosts: all + gather_facts: yes + vars: + timezone: Europe/Copenhagen + ntp_server: dk.pool.ntp.org + + tasks: + + - name: Configure timezone + ansible.builtin.replace: + path: /etc/environment + regexp: '^TZ=(.*)$' + replace: "TZ={{ timezone }}" + + - name: Update time from NTP server + ansible.builtin.command: /usr/sbin/ntpdate {{ ntp_server }} + + - name: Create cron entry for updating time periodically + ansible.builtin.cron: + name: ntpdate + weekday: "*" + minute: "1" + hour: "*" + user: root + job: "/usr/sbin/ntpdate {{ ntp_server }}" diff --git a/gradle.properties b/gradle.properties index d015b8f..da8f1bf 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ version=0.0.6 pf4jVersion=3.6.0 -slf4jVersion=1.7.31 +slf4jVersion=1.7.32 camelVersion=3.11.0 picocliVersion=4.6.1 -oshiVersion=5.7.5 \ No newline at end of file +oshiVersion=5.8.1 \ No newline at end of file diff --git a/plugins/build.gradle b/plugins/build.gradle index c2ed79c..c5919ca 100644 --- a/plugins/build.gradle +++ b/plugins/build.gradle @@ -1,7 +1,7 @@ import org.redline_rpm.header.Os plugins { - id "nebula.ospackage" version "8.5.6" + id "nebula.ospackage" version "8.6.1" } diff --git a/plugins/os-base/gradle.properties b/plugins/os-base/gradle.properties index 3aaf9bc..db66d99 100644 --- a/plugins/os-base/gradle.properties +++ b/plugins/os-base/gradle.properties @@ -1,7 +1,5 @@ pluginId=sysmon-base pluginClass=sysmon.plugins.os_base.BasePlugin -pluginVersion=0.0.1 -pluginProvider=System Monitor pluginDependencies= pluginDescription=Base OS metrics where supported. diff --git a/plugins/os-ibmi/gradle.properties b/plugins/os-ibmi/gradle.properties index cf7297d..18a185f 100644 --- a/plugins/os-ibmi/gradle.properties +++ b/plugins/os-ibmi/gradle.properties @@ -1,6 +1,4 @@ pluginId=sysmon-ibmi pluginClass=sysmon.plugins.os_ibmi.IbmIPlugin -pluginVersion=0.0.1 -pluginProvider=System Monitor pluginDependencies= pluginDescription=Collects IBM-i OS metrics. \ No newline at end of file diff --git a/server/build.gradle b/server/build.gradle index 4513ec5..ffa0468 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -5,7 +5,7 @@ plugins { id "com.github.johnrengelman.shadow" version "7.0.0" id "net.nemerosa.versioning" version "2.14.0" - id "nebula.ospackage" version "8.5.6" + id "nebula.ospackage" version "8.6.1" } dependencies { diff --git a/shared/build.gradle b/shared/build.gradle index 936de1d..3178e62 100644 --- a/shared/build.gradle +++ b/shared/build.gradle @@ -17,9 +17,9 @@ repositories { } dependencies { - testImplementation 'org.codehaus.groovy:groovy:3.0.7' - testImplementation 'org.spockframework:spock-core:2.0-M4-groovy-3.0' - testImplementation 'junit:junit:4.13.1' + testImplementation 'org.codehaus.groovy:groovy:3.0.8' + testImplementation 'org.spockframework:spock-core:2.0-groovy-3.0' + testImplementation 'junit:junit:4.13.2' testImplementation "org.slf4j:slf4j-api:${slf4jVersion}" implementation "org.slf4j:slf4j-api:${slf4jVersion}"