From cb482264d03f55d327d89cf9c759ecabba0eecd9 Mon Sep 17 00:00:00 2001 From: Mark Nellemann Date: Fri, 14 Aug 2020 11:50:44 +0200 Subject: [PATCH] Updates to rpm and deb builds. --- README.md | 2 +- build.gradle | 7 ++-- doc/README.txt | 7 ++++ doc/grafana-metrics.txt | 34 ------------------- conf/hmci.groovy => doc/hmci.groovy.tpl | 16 +++++---- gradle.properties | 2 +- src/main/groovy/biz/nellemann/hmci/App.groovy | 4 +-- 7 files changed, 24 insertions(+), 48 deletions(-) create mode 100644 doc/README.txt delete mode 100644 doc/grafana-metrics.txt rename conf/hmci.groovy => doc/hmci.groovy.tpl (54%) diff --git a/README.md b/README.md index 4a4d86e..677cbce 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Small utility to fetch metrics from one or more HMC's and push those to an Influ - Ensure you have correct date/time and NTP running to keep it accurate. -Modify the */opt/hmci/conf/hmci.groovy* configuration file to suit your environment and run the program: +Copy the *doc/hmci.groovy.tpl* file into */etc/hmci.groovy*, change the configuration to suit your environment and run the program: /opt/hmci/bin/hmci diff --git a/build.gradle b/build.gradle index 4d7bbb4..eb36c5d 100644 --- a/build.gradle +++ b/build.gradle @@ -39,7 +39,6 @@ apply plugin: 'nebula.ospackage' ospackage { packageName = 'hmci' release = '1' - os = LINUX user = 'root' packager = "Mark Nellemann " @@ -53,14 +52,16 @@ ospackage { into 'bin' } - from('conf/') { - into 'conf' + from('doc/') { + into 'doc' } + } buildRpm { dependsOn startShadowScripts requires('java-1.8.0-openjdk-headless') + os = LINUX } buildDeb { diff --git a/doc/README.txt b/doc/README.txt new file mode 100644 index 0000000..0330bb6 --- /dev/null +++ b/doc/README.txt @@ -0,0 +1,7 @@ +HMCi - HMC Insights + +Requires Java 8 (or later) runtime. +For more information, visit https://bitbucket.org/nellemann_biz/hmci + + + diff --git a/doc/grafana-metrics.txt b/doc/grafana-metrics.txt deleted file mode 100644 index 60a32db..0000000 --- a/doc/grafana-metrics.txt +++ /dev/null @@ -1,34 +0,0 @@ - -PartitionProcessor - - UtilizedProcUnits => utilizedProcUnits - - /apped/ - - /Time/ => /time/ - -PartitionMemory - - - -PartitionVirtualEthernetAdapters - - /Bytes/ - - /PhysicalBytes/ - - -PartitionVirtualFiberChannelAdapters - - Bytes - - /trans/ - - -SystemSharedProcessorPool - - !availableProcUnits - - -SystemProcessor - - /Units/ - -SystemMemory - - - -SystemFiberChannelAdapters - - /writeByt/ - -SystemSharedAdapters - - transferredBytes diff --git a/conf/hmci.groovy b/doc/hmci.groovy.tpl similarity index 54% rename from conf/hmci.groovy rename to doc/hmci.groovy.tpl index eed8efd..d98af3d 100644 --- a/conf/hmci.groovy +++ b/doc/hmci.groovy.tpl @@ -1,17 +1,19 @@ /* - Configuration for HMCi - */ + Copy this file to /etc/hmci.groovy and change it to suit your environment. +*/ +// Query HMC's for data - in seconds hmci.refresh = 30 + +// Rescan HMC's for new systems and partitions - every x refresh hmci.rescan = 60 // InfluxDB to save metrics influx { - url = "http://10.32.64.29:8086" + url = "http://localhost:8086" username = "root" password = "" database = "hmci" - } // One or more HMC to query for data and metrics @@ -19,15 +21,15 @@ hmc { // HMC on our primary site site1 { - url = "https://10.32.64.39:12443" + url = "https://10.10.10.10:12443" username = "hmci" password = "hmcihmci" - unsafe = true + unsafe = true // Ignore SSL cert. errors } /* site2 { - url = "https://10.32.64.39:12443" + url = "https://10.10.20.20:12443" username = "viewer" password = "someSecret" unsafe = false diff --git a/gradle.properties b/gradle.properties index 4888667..5bcf16f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ group = biz.nellemann.hmci -version = 1.0.1 \ No newline at end of file +version = 1.0.2 diff --git a/src/main/groovy/biz/nellemann/hmci/App.groovy b/src/main/groovy/biz/nellemann/hmci/App.groovy index d44e716..350568e 100644 --- a/src/main/groovy/biz/nellemann/hmci/App.groovy +++ b/src/main/groovy/biz/nellemann/hmci/App.groovy @@ -151,10 +151,10 @@ class App implements Runnable { static void main(String... args) { - def cli = new CliBuilder() + def cli = new CliBuilder(name: "hmci") cli.h(longOpt: 'help', 'display usage') cli.v(longOpt: 'version', 'display version') - cli.c(longOpt: 'config', args: 1, required: true, defaultValue: '/opt/hmci/conf/hmci.groovy', 'configuration file') + cli.c(longOpt: 'config', args: 1, required: true, defaultValue: '/etc/hmci.groovy', 'configuration file') OptionAccessor options = cli.parse(args) if (options.h) cli.usage()