<div dir="ltr">David<div><br></div><div style>Making a cpu status message requires it to be formatted just right.</div><div style><br></div><div style>Instead, you can craft up a "client" message for the device, and Hobbit (the hobbitd_channel process) will parse the client data for [top] and [uptime] messages and feed them into hobbitd_client, which generates status and data messages on behalf of the client.  The data/status messages should be formatted in the way Hobbit can use to create and show graphs.  More info in the man page for hobbitd_client, such as here:</div>

<div style><br></div><div style><a href="http://hobbit.math.cnrs.fr/hobbit/help/manpages/man8/hobbitd_client.8.html" rel="noreferrer">http://hobbit.math.cnrs.fr/hobbit/help/manpages/man8/hobbitd_client.8.html</a></div><div style>

<br></div><div style>The load average is actually gleaned from the 'uptime' data, and not from 'top'.  If you can generate a valid client message showing an [uptime] section, then it should create a cpu page and graph data.  The uptime message needs to be a form expected by hobbitd_client, such as:</div>

<div style><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap"> 10:05am  up 27 day(s),  9:16,  1 user,  load average: 0.32, 0.36, 0.33
</pre><div style>So all you need to do is something like so:<br></div></div><div style><br></div><div style><p class="" style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:'Courier New';color:red">/usr/local/bin/bb<u></u><u></u></span></p>

<p class="" style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:'Courier New';color:red">192.168.0.1<u></u><u></u></span></p><p class="" style="font-family:arial,sans-serif;font-size:13px">

<span style="font-family:'Courier New';color:red">client qcosvhsm1.linux<u></u></span></p><p class="" style="font-family:arial,sans-serif;font-size:13px"><span style="color:red;font-family:'Courier New'">[uptime]</span><br>

</p><p class="" style="font-family:arial,sans-serif;font-size:13px"><span style="color:rgb(255,0,0);font-family:'Courier New'">10:05am  up 1 day(s), 9:16, 1 user, load average: 0.10, 0.10, 0.09</span><br></p><div style>

Once hobbitd_client parses the message, it then creates a "cpu" status message to inject into Hobbit, and the message gets collected by hobbitd_rrd (via hobbitd_channel), and hobbitd_rrd pushes the numbers into la.rrd (test-to-RRD-filename translation is specified by TEST2RRD).</div>

<div style><br></div><div style>You could bypass the client message, and just create a "cpu" status message of the correct format, but I've found it easier to use a client message for all the different things I want to collect, and send them all to Hobbit at once.</div>

<div style><br></div>The same principle applies to other data collected and graphed from client messages, such as disk space, memory, interface usage.</div><div style><br></div><div style>Cheers</div><div style>Jeremy</div>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">On 3 April 2013 09:21, Haertig, David F (Dave) <span dir="ltr"><<a href="mailto:haertig@avaya.com" target="_blank">haertig@avaya.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal">My installation is an old Hobbit 4.2.0 one, but in case the graphing is still similar to the way Xymon does things nowadays, I thought I’d ask here.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I am familiar with custom graphs, using NCV, and have implemented many.  I am looking to try something a little different from that.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I have a network appliance (not a “server”) that cannot have the Hobbit client installed on it, but I can gather CPU load info from it like this “ssh user@appliance status cpu”.  This generates a response like this example:
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">0.18 0.14 0.10 3/74 29150<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">Command Result : 0 (Success)<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I currently use the above collected data to create a “status” message that I then use the “bb” command to send to Hobbit.  Works as expected, with the data showing up in the “cpu” column for this appliance I am monitoring:<u></u><u></u></p>


<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:red">/usr/local/bin/bb<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:red">192.168.0.1<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:red">status qcosvhsm1.cpu green Tue Apr  2 15:55:<a href="tel:16%202013" value="+61162013" target="_blank">16 2013</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:red">CPU load<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:red">========<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:red"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:red">&green 5 minute average CPU load is 0.10, which is <= warning level of 3<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:red"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:red">load average: 0.10, 0.10, 0.09<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:red"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:red">Raw data (command = 'status cpu'):<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:red">   0.10 0.10 0.09 3/74 7177<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:red">   Command Result : 0 (Success)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New";color:red"><u></u> <u></u></span></p>
<p class="MsoNormal">(I have other custom stuff that turns text like “&green” into a link to the green light icon Hobbit normally uses, but that’s irrelevant to my questions here.)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><b>What I would like to do is use the built-in RRD and “CPU Load” graph definitions to display a graph on the Hobbit webpage.</b>  I realize I can make my own custom ones, and I know how to do that already (but not showing up on the default
 “cpu” column, I’d have to make a different “cpu_load” column using a different name than just “cpu”), but I wanted to try sending my data into Hobbit to force it to use the built-in definitions rather than my own custom defs.  You can see in the above bb message
 I formatted a part of the text as “load average: 0.10, 0.10, 0.09” so that would mimic what Hobbit normally sees in the data typically collected with “top” (which I believe is how it collects data on CPU load – but I’m not sure of Hobbits internals in this
 case – possibly it uses some other command, maybe “uptime”).<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Do I need to send an additional “data” message along with the “status” message above to trigger the graphing?  What format would that data message require?  Typically for a custom graph you add onto the TEST2RRD line with “column_name=ncv”
 but I can see as part of the original TEST2RRD line that there already is a part that says “cpu=la”.  As I understand TEST2RRD (and I don’t understand it all that well), I think this means that incoming “status” and “data” messages for “cpu” are directed to
 some internal “la” module.  I am working on the assumption that all’s I need to do to invoke the built-in graphing defs for “CPU Load” is to format my custom status message so that the “la” module can parse out the load data it needs for graphing.  Am I even
 close to being correct in this assumption?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Any tips on how I should proceed?  This is as much a mental gymnastics exercise as anything.  It is going into a production system and I know how to skin this cat another way.  I was just hoping to learn how to skin this cat using the already
 built-in “CPU Load” graphing definitions.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks in advance!<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>

<br>_______________________________________________<br>
Xymon mailing list<br>
<a href="mailto:Xymon@xymon.com">Xymon@xymon.com</a><br>
<a href="http://lists.xymon.com/mailman/listinfo/xymon" target="_blank">http://lists.xymon.com/mailman/listinfo/xymon</a><br>
<br></blockquote></div><br></div>