From 21dabd17ba0b5af95d0cf2a7bf4374e06fedf6f6 Mon Sep 17 00:00:00 2001 From: Sebastian YEPES F Date: Sat, 6 Jun 2015 00:51:54 +0200 Subject: [PATCH] Public release + InfluxDB support --- CHANGELOG.md | 41 +++++++++++++++++++ build.gradle | 4 +- .../{vSphere2Graphite => VSphere2Metrics} | 4 +- ...Graphite.groovy => VSphere2Metrics.groovy} | 7 ++-- src/main/resources/logback.groovy | 4 +- 5 files changed, 51 insertions(+), 9 deletions(-) create mode 100644 CHANGELOG.md rename src/dist/{vSphere2Graphite => VSphere2Metrics} (91%) rename src/main/groovy/{vSphere2Graphite.groovy => VSphere2Metrics.groovy} (99%) diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..c7b74ac --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,41 @@ +# 1.5.0 (2015-06-06) +- Add InfluxDB support and upgrade MetricClient +- First public release + +# 1.4.1 (2015-06-06) +- Fix build order + +# 1.4.1 (2015-06-04) +- Metrics retrieval TimeOut +- logback config fixes + +# 1.4.0 (2014-04-22) +- Collect ESXi Events and upgrade MetricClient + +# 1.3.0 (2014-04-07) +- Use MetricClient and support pickle format + +# 1.2.0 (2014-04-05) +- Minor fixes and Groovy/vijava upgrade + +# 1.1.1 (2013-03-04) +- Catch empty Hosts/VMs + +# 1.1.0 (2013-02-19) +- CliBuilder parameters + +# 1.0.4 (2013-01-30) +- Take into account the execution time (lastExecTime) + +# 1.0.3 (2012-07-02) +- Collect Host metrics + +# 1.0.2 (2012-06-28) +- Daemonize, created config file and other fixes + +# 1.0.1 (2012-06-21) +- Added parallel vCenter collecting + +# 1.0.0 (2012-06-06) +- Initial version + diff --git a/build.gradle b/build.gradle index 2f9763e..524b190 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,10 @@ apply plugin:'groovy' apply plugin:'distribution' -def projectName = 'vSphere2Graphite' +def projectName = 'VSphere2Metrics' description = "$projectName - ESXi Performance Metric Integration with Graphite & InfluxDB" -group = 'com.allthingsmonitoring.vmware.vSphere2Graphite' +group = 'com.allthingsmonitoring.vmware.VSphere2Metrics' archivesBaseName = projectName distsDirName = 'dist' version = '1.5' diff --git a/src/dist/vSphere2Graphite b/src/dist/VSphere2Metrics similarity index 91% rename from src/dist/vSphere2Graphite rename to src/dist/VSphere2Metrics index 3475907..a7064b6 100644 --- a/src/dist/vSphere2Graphite +++ b/src/dist/VSphere2Metrics @@ -1,4 +1,4 @@ -cd /opt/vSphere2Graphite +cd /opt/VSphere2Metrics export JAVA_HOME=/usr/java/latest export PATH=$JAVA_HOME/bin:$PATH:. @@ -10,4 +10,4 @@ export PATH=$JAVA_HOME/bin:$PATH:. # Java 8 export JAVA_OPTS="-d64 -server -Xms1g -Xmx5g -verbose:gc -XX:+UseG1GC -XX:+UseStringDeduplication -XX:StringDeduplicationAgeThreshold=4 -XX:ConcGCThreads=8 -XX:ParallelGCThreads=8 -XX:SurvivorRatio=8 -XX:G1ReservePercent=15 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:InitiatingHeapOccupancyPercent=25 -XX:MaxGCPauseMillis=500 -XX:G1HeapRegionSize=32 -XX:+UseFastAccessorMethods -XX:+UseCompressedOops -XX:+AggressiveOpts -XX:+ExplicitGCInvokesConcurrent -XX:+ScavengeBeforeFullGC -XX:+PrintGC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintHeapAtGC -XX:+PrintStringDeduplicationStatistics -Xloggc:$PWD/logs/gc_`date +%Y%m%d-%H%M%S`.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$PWD/logs/dump_`date +%Y%m%d-%H%M%S`.hprof" -java $JAVA_OPTS -Dpid=$$ -Dapp.env=PROD -jar $PWD/vSphere2Graphite-1.4.jar $* 2>&1 |tee -a logs/vSphere2Graphite_console.log +java $JAVA_OPTS -Dpid=$$ -Dapp.env=PROD -jar $PWD/VSphere2Metrics-1.5.jar $* 2>&1 |tee -a logs/VSphere2Metrics_console.log diff --git a/src/main/groovy/vSphere2Graphite.groovy b/src/main/groovy/VSphere2Metrics.groovy similarity index 99% rename from src/main/groovy/vSphere2Graphite.groovy rename to src/main/groovy/VSphere2Metrics.groovy index d4661c0..2011fb2 100644 --- a/src/main/groovy/vSphere2Graphite.groovy +++ b/src/main/groovy/VSphere2Metrics.groovy @@ -43,7 +43,7 @@ import com.allthingsmonitoring.utils.MetricClient @Slf4j -class vSphere2Graphite { +class VSphere2Metrics { TimeDuration lastExecTime = new TimeDuration(0, 0, 0, 0) TimeDuration startFromExecTime = new TimeDuration(0, 0, 0, 0) @@ -54,7 +54,7 @@ class vSphere2Graphite { /** * Constructor */ - vSphere2Graphite(String cfgFile='config.groovy') { + VSphere2Metrics(String cfgFile='config.groovy') { cfg = readConfigFile(cfgFile) Attributes manifest = getManifestInfo() log.info "Initialization: Class: ${this.class.name?.split('\\.')?.getAt(-1)} / Collecting samples: ${cfg?.vcs?.perf_max_samples} = ${cfg?.vcs?.perf_max_samples * 20}sec / Version: ${manifest?.getValue('Specification-Version')} / Built-Date: ${manifest?.getValue('Built-Date')}" @@ -803,6 +803,7 @@ class vSphere2Graphite { } break case ~/^(sys)\..*/: + // TODO: Implement return break default: @@ -1149,7 +1150,7 @@ class vSphere2Graphite { if (!opt) { return } else if (opt.h | opt.arguments().size() != 0) { cli.usage(); return } try { - def main = new vSphere2Graphite() + VSphere2Metrics main = new VSphere2Metrics() // Parse 'Start from' parameter if (opt.sf) { diff --git a/src/main/resources/logback.groovy b/src/main/resources/logback.groovy index a52b9d1..e8aba56 100644 --- a/src/main/resources/logback.groovy +++ b/src/main/resources/logback.groovy @@ -12,8 +12,8 @@ import ch.qos.logback.classic.LoggerContext import java.lang.management.ManagementFactory -String baseName = 'vSphere2Graphite' -ArrayList classNames = ['com.allthingsmonitoring.vmware.vSphere2Graphite','com.allthingsmonitoring.utils.MetricClient'] +String baseName = 'VSphere2Metrics' +ArrayList classNames = ['com.allthingsmonitoring.vmware.VSphere2Metrics','com.allthingsmonitoring.utils.MetricClient'] Map defaultLevels = setLoggerLevels() if (System.properties['app.env']?.toUpperCase() == 'DEBUG'){ statusListener(OnConsoleStatusListener) }