Grafana, Telegraf, Smokeping, oh my…

So, I’ve been working on something.  I keep seeing all of these very nice home lab dashboards on /r/homelab and I thought it would be useful to create one for myself.  I present to you, my home dashboard, which is hanging in the kitchen on an old iPad we weren’t using:

Getting to this point was not without challenges.  In fact, it was painful at times.  I’m going to try to document my setup here.  Because of all of the twists and turns along the way, I would say this is not a complete guide.  There are parts of this that you’ll have to figure out for yourself.  It also assumes some knowledge of linux, Ubuntu in particular.  If I get comments asking about specific sections, I’ll try to update the post with current info.

So, what do we have here?  The picture you see above is made up of a number of components.  InfluxDB is a time based DB, much like RRDTool or the original MRTG.  It’s designed to take in datapoints, tag them with a timestamp, and then move on.  It might be capable of more, but we’re not using it for anything else.  Grafana is the visualization tool that creates what you see above.  Grafana is very configurable, which I’ll dive into more in a bit.  The final piece of the puzzle is data collection.  There are a number of ways to get data into InfluxDB.  I’m using Telegraf and some interesting scripting.

Let’s start by getting some links in here.  I’ll update this as I update the post.

This is where it all started for me:

https://lkhill.com/using-influxdb-grafana-to-display-network-statistics/

This was useful for the Grafana configuration:

Setup a wicked Grafana Dashboard to monitor practically anything

InfluxData, which includes InfluxDB and Telegraf

https://www.influxdata.com/

Grafana for the visualization:

http://grafana.org/

The “SmokePing” stand-in:

https://hveem.no/visualizing-latency-variance-with-grafana

The Unraid tools:

https://lime-technology.com/forum/index.php?topic=52220.msg512346#msg512346

Ok, here we go…

First, I would start with the top link to lkhill’s instructions.  Use that to get up and running with InfluxDB and Grafana installed.  DO NOT follow that guide for the InfluxSNMP install.  Telegraf takes care of SNMP now.  If I recall, InfluxData wants your…data, in order to download InfluxDB.  It’s cool though, because they’ll send you some swanky stickers.  I believe these are still valid instructions for installing Telegraf:  https://docs.influxdata.com/telegraf/v1.1/introduction/installation/

I would suggest getting to this point with InfluxDB, Grafana and Telegraf installed and not throwing errors before you proceed with any configuration.  I know I’m skipping a lot of things that might not work without some tweaking.  Like I said, I’ll update this if I get feedback that these installations need to be detailed.  Add the data source as shown in lkhill’s instructions.

At this point you should have some data being populated for the localhost and the data source should have been available.  I would suggest diverting from lkhill’s instructions at this point.  Instead of adding a graph for SNMP stats (we have none at this point), let’s set up a graph of the local CPU utilization.  Add a new dashboard and then click on the small green square in the upper left.  Click on the “A” select statement and it’ll expand to show you options for finding the data.  Clicking on each of the fields will either give you a drop down list of options, or it might give you an X above the item.  For instance, if you click on mean() you’ll get the x above that.  Click the x to delete mean().  Clicking the + at the end of each row will give you a list of options to add from.  Try to get your selection to look like this:

Click the big X out on the right of the tab bar, past Time range, to close the edit and return to the dashboard.  Congrats, you just made your first dashboard!  Let’s get some useful data in there.

First thing to take care of is to add SNMP.  Go to /etc/telegraf/ and edit telegraf.conf.  If there’s not a conf file, there might be a template called dpkg-dist in there.  If not, you can create a new template.  I found this extremely helpful for working through Telegraf issues:  https://github.com/influxdata/telegraf  You can also go right to the SNMP readme at https://github.com/influxdata/telegraf/tree/master/plugins/inputs/snmp

You can see that Telegraf has quite a few plugins for gathering data.  SNMP is only one part of it.  Some configuration is necessary to start using Telegraf.  Near the top of the file are general settings that must be configured.  Make sure in the OutputPlugins section the urls, database and username/password are uncommented and correct.  The database can be called whatever you want, and you can have multiple databases in Grafana.  Find the “inputs.snmp” section and we’ll begin editing it.  Here’s mine:

# # Retrieves SNMP values from remote agents
[[inputs.snmp]]
agents = [ “192.x.x.x:161” ]
timeout = “5s”
version = 3

max_repetitions = 50

sec_name = “SNMPv3User”
auth_protocol = “SHA” # Values: “MD5”, “SHA”, “”
auth_password = “topsecret”
sec_level = “authPriv” # Values: “noAuthNoPriv”, “authNoPriv”, “authPriv”

priv_protocol = “AES” # Values: “DES”, “AES”, “”
priv_password = “alsotopsecret”

name = “nutanix”
[[inputs.snmp.field]]
name = “host1CPU”
oid = “1.3.6.1.4.1.41263.9.1.6.1”
[[inputs.snmp.field]]
name = “host2CPU”
oid = “1.3.6.1.4.1.41263.9.1.6.2”
[[inputs.snmp.field]]
name = “host3CPU”
oid = “1.3.6.1.4.1.41263.9.1.6.3”
[[inputs.snmp.field]]
name = “ClusterIOPS”
oid = “1.3.6.1.4.1.41263.506.0”
[[inputs.snmp.field]]

name = “Host1MEM”
oid = “1.3.6.1.4.1.41263.9.1.8.1”
[[inputs.snmp.field]]
name = “Host2MEM”
oid = “1.3.6.1.4.1.41263.9.1.8.2”
[[inputs.snmp.field]]
name = “Host3MEM”
oid = “1.3.6.1.4.1.41263.9.1.8.3”

[[inputs.snmp]]
agents = [ “192.x.x.x:161” ]
timeout = “5s”
retries = 3
version = 2
community = “topsecret”
max_repetitions = 10

name = “ERX”
[[inputs.snmp.field]]

name = “Bytes.Out”
oid = “1.3.6.1.2.1.2.2.1.10.2”
[[inputs.snmp.field]]
name = “Bytes.In”
oid = “1.3.6.1.2.1.2.2.1.16.2”

I’ve edited the IP addresses and security info, so make sure that matches whatever you have set up.  Oh yeah, you have to enable SNMP on your devices!  A couple of key points for this, you can have different SNMP versions or authentication methods defined by adding a new [[inputs.snmp]] for each one.  I’m also using the full OIDs, but you can see in the template that it’s possible to reference a MIB by name as well.  Save that and exit.  You can test the file with

telegraf –config telegraf.conf -test

This will give you lines for each device you’ve configured and show you what the response is.  If you don’t see data, something’s wrong with the snmp config.

Nutanix CE is operational

I’ve been running on a Nutanix CE install for about a month now.  With the November release they added some much needed GUI controls for the image service.  You can now import ISOs for install images, without having to fiddle with CLI stuff.

I’ve had virtually no problems, and the VMs are performing well.  If there’s one complaint I have with this solution it’s that the baseline memory utilization is high.  I couldn’t reduce the CVM’s to less than 8GB each without running into serious problems with the cluster.  Plus, there seems to be a missing 3GB per host.  I’m assuming this is what the actual CE and KVM host requires, but that seems high.  I know I can run VMWare ESXi in less than 1GB per host.  So, 11GB per host is used up right from the start.  Since I’m running this on a shoestring budget with 16GB per host, I really only have 5GB available for VMs.  That kinda sucks.

On the upside, the CVM’s at 8GB work fine and the IO performance is pretty amazing.  I’ve seen upwards of 1600 IOPS at times.  This is basically a single consumer grade 240GB SSD in each host for the primary tier and 640GB HDD for the secondary tier.  I don’t think I’m even using the secondary yet.  3 hosts at varying levels of i5 CPU’s, but none of them current gen.

I’m pretty happy with this and I’m looking forward to seeing what Nutanix does next.

Nutanix CE challenges

The Nutanix install has been moving along.  I would not say it’s ready for more than lab use, but it’s getting there.  I’m setting up a 3 node cluster, and one of the nodes, which has an Intel motherboard, kept throwing a generic error about not being able to find the sysinfo.  Thanks to the help from the forum, I was able to hard code a product name in order to get past the install.  I don’t think it will have an impact on operation, only install, but it’s one of those little things that crops up with new software.

The link is here, if you’re able to access it:  http://next.nutanix.com/t5/Discussion-Forum/Install-failing-with-quot-unable-to-gather-basic-hardware/td-p/5034/page/2

 

Nutanix in the house

About 2 months ago Nutanix.com released a free software only version of their magic, called Community Edition.  I got on the list for this as quickly as I could, but I haven’t been able to install it until now.  See, I wanted to have an actually cluster, what the call RF2 (Redundancy Factor), which would require me to blow away my existing XenServer install to get to enough compatible hardware.  I also needed to purchase SSD’s for each of the nodes in the cluster.

Well, I’ve done that now.  At the moment, I’m exporting my VM’s out of XenServer to OVA’s, in the hope I can restore them from that.  If I can’t, well….I’m not sure then.  I may just rebuild everything from scratch.  I’d really like to figure out how to import them, though.

What I’ll have when I’m done is a 3 node RF2 cluster, with the minimum a 240GB SSD, and at least a 500GB HDD in each node.   All 3 nodes are i5’s, of different vintages. Not a lot of space, once you run the Nutanix overhead, but it’ll be enough for my needs.  I’ll post some screenshots and pics once I’m up and running.

Ubuntu 14.04 and Xenserver 6.2 problems

I’ve had my Plex Media Server running on Ubuntu 12.04 on XS 6.2 for a while now.  It recently started nagging me to upgrade to 14.04.  Didn’t see a reason not to do this, but I also didn’t do much digging to see if there were known issues.  Turns out, 14.04 is not a “supported” version on XS 6.2.  The updated image refused to boot.  It ended up being a pretty simple fix of going into the XS host and modifying a Grub configuration file.  It was an easy thing to find through googling.  First item in the results.

I should also mention, the Ubuntu Dist Upgrade also uninstalled Plex.  That was an easy fix, but it did require a reboot for Plex to start working.

XenServer 6 and Unraid NFS…I gave up

I actually did this a little while ago and forgot to post about it.  I could not get NFS to work between XenServer and Unraid.  So, I scrounged up some hardware and punted.  I installed OpenFiler and iSCSI.

And it worked.

Angels sang.  Rainbows shone.  Something about unicorns…

It’s been working great.  I just have a new problem.  The hardware I’ve been using for XenServer is my old PC hardware.  It’s 1st gen i5 so it should be plenty for my limited requirements, and it is.  It’s just getting hung randomly now.  I had this problem when it was my PC.  In fact, that’s why I upgraded.  Looks like it’s hardware related.  So, now I’m contemplating getting a new MoBo and CPU.  What a drag.

The good news is, I’m pretty sure I’ll be able to go to all XenServer and get rid of the VMWare, all while retaining live migration across the iSCSI pool.  VMWare, I’d love to stick with you, but I need live migration in the free version.

Being on a XenServer has another benefit.  I might try something like Puppet, just for kicks.  🙂

Not so fast….back to XenServer

Just…can’t…get…it…to…work.  So, I’m going to try XenServer free again and ask for help at the support forums for both Citrix and Unraid.  I managed to get noac to populate into the NFS settings but lookupcache=none isn’t taking.  There are other settings in there and I’m wondering if they’re getting in the way.  I have to believe there’s a way to make this work.  From the nfsstat -m on the server:

/var/run/sr-mount/1804503a-ac43-f0eb-cd4a-18eff5098f21 from 192.168.169.8:/mnt/user/ISOs
Flags: rw,sync,relatime,vers=3,rsize=131072,wsize=131072,namlen=255,acregmin=0,acregmax=0,acdirmin=0,acdirmax=0,soft,noac,proto=tcp,port=65535,timeo=133,retrans=0,sec=sys,mountport=65535,local_lock=none,addr=192.168.169.8

XenServer 6.2 free, bye, bye … hello Xen!

Despite my best efforts I couldn’t maintain a stable NFS connection for the network share to Unraid.  I’ve decided to bag it and try building a Xen hypervisor up from an Ubuntu install.  It looks like XenCenter should still be able to manage it so I should be able to take advantage of the slightly more polished GUI.  I’m hoping (but not yet sure) that I’ll be able to use Ubuntu’s regular NFS tools to map the shares and I already know that works well with the proper settings.  More once I have that working.

XenServer 6.2 free and NFS shares on Unraid

I recently ran across a problem with XenServer 6.2 when connecting to my Unraid on NFS.  It kept dropping the NFS connection but I couldn’t determine why.  I thought it might be Xen related and reinstalled straight Ubuntu 12.04 instead.  However, I started having the same problem with Ubuntu with mounted NFS shares.  It would seem to age them out.  Luckily, Ubuntu gave me some more info and would throw up a message about “Stale NFS File Handles”.  A little more digging and I come across a couple of things on the Unraid user forum that point to Unraid being the problem.

http://lime-technology.com/forum/index.php?topic=27604.msg243305#msg243305

http://lime-technology.com/forum/index.php?topic=27874.msg246978#msg246978

Using both of these I was able to get a stable connection from Ubuntu to Unraid.  I set the tunable in the Unraid NFS settings to -1 and added the lookupcache option on Ubuntu.  I didn’t do any performance testing.

Now, I’ve tried going back to XenServer hoping that the Unraid tunable would be enough to fix the issue in Xen.  It’s not.  Still had a loss of connectivity to the Unraid NFS share after a couple of hours.  I’ve just now gone into the Xen settings per this post:  http://likerabbits.blogspot.com/2009/09/xenserver-performance-tweaks.html and added the noac option.

We’ll see how it goes over the next several hours.

Updated:  No luck with adding lookupcache=none and noac to the basic options.  It still croaked after 15-20 minutes.  I found another reference to checking the /etc/mtab file and saw some more options, including one for actimeo.  I’m trying it with that eliminated to see if it makes a difference.

Second update: commenting out actimeo might have worked.  I’m only 2 hours in but I think this is longer than previous failures.  I’ll create a new post with the necessary changes, if this ends up working.