Search code examples
stackdrivergoogle-cloud-monitoring

Is it possible to Compile Stackdriver monitoring agent from source


It appears that Ubuntu 15:10 does not yet have a Stackdriver monitoring agent package available. Is the source available to be installed?


Solution

  • I work at Google on the Stackdriver agent. On Ubuntu, we only support the LTS releases, so if you could use Ubuntu 14.04 or 16.04 that would be our strong preference.

    It might also be possible to use the 14.04 or 16.04 package and modify it so it works with 15.10.

    But that said, if you really want to build on 15.10 these are the instructions for doing so. I have just tested them on a 15.10 instance so I can confirm they work as of five minutes ago. :-)

    Again we do not officially support 15.10 so if this does not work reliably, we would not be able to offer any additional help.

    sudo apt-get -y update && sudo apt-get -y install git flex bison gcc automake pkg-config libtool libgcrypt-dev glib2.0-dev make libssl-dev libyajl-dev libcurl4-openssl-dev
    git clone https://github.com/Stackdriver/collectd.git
    cd collectd/
    git checkout stackdriver-agent-5.5.0
    ./clean.sh && ./build.sh
    ./configure --prefix=/opt/stackdriver/collectd --program-prefix=stackdriver- --disable-all-plugins --enable-cpu --enable-df --enable-disk --enable-load --enable-logfile --enable-memory --enable-swap --enable-syslog --enable-interface --enable-tcpconns --enable-write_http --enable-write_gcm --disable-static --enable-aggregation --enable-csv --enable-nginx --enable-apache --enable-memcached --enable-mysql --enable-postgresql --disable-perl --without-libperl --without-perl-bindings --enable-mongodb --with-libmongoc=own --enable-plugin_mem --enable-processes --enable-ntpd --enable-zookeeper --enable-exec --enable-curl_json --enable-match_regex --enable-target_set --enable-match_throttle_metadata_keys --enable-target_replace --enable-target_scale --enable-debug --with-useragent="stackdriver_agent/myagent"
    make
    sudo make install
    

    Then obtain a suitable collectd.conf and run it in the foreground with

    sudo /opt/stackdriver/collectd/sbin/stackdriver-collectd -f -C ~/my.collectd.conf 
    

    or in the background by leaving out the -f.

    The easiest way to get a "suitable" collectd.conf is to get our production package, install or examine it, and use the file /opt/stackdriver/collectd/etc/collectd-gcm.conf.tmpl modified to your tastes.