<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:EN-GB;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thanks to Claudio for finding the solution to this issue.  To add to the instructions below I found that on my installation the line in nagiosgraph.conf to enable the rrdopts.conf file was commented out.  You will need to uncomment this and make sure that it points to the correct place in order for the graphs to be correctly updated.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>James<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Claudio Kuenzler [mailto:ck@claudiokuenzler.com] <br><b>Sent:</b> 19 December 2012 14:19<br><b>To:</b> Nagios Users List<br><b>Subject:</b> Re: [Nagios-users] Nagios Graph converting figures to binary bytes rather than decimal<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>James and I continued the troubleshooting off-list and we came to the solution, which we want to share of course. <br>Here's more or less my mail:<br><br>---------------------------------------<br><br>You're absolutely right, the graphs were not correct. With both *1000**2 and *1024**2. <br><br>Actually, thanks to your e-mail I figured that in the past years I've lived in denial. I must have come up with the multiplication of 1000 in the map file as a kind of workaround, because the graph was closer to the actual reality. Then I must have forgotten that and went on.... <br><br>I broke it down to this:<br><br><span style='font-family:"Courier New"'># df<o:p></o:p></span></p><div><p class=MsoNormal><span style='font-family:"Courier New"'><br>Filesystem      Size               Used              Avail             Use% Mounted on<o:p></o:p></span></p></div><p class=MsoNormal><span style='font-family:"Courier New"'>/dev/md4         682587992     117456312     530731228      19% /<br><br># df -h<o:p></o:p></span></p><div><p class=MsoNormal><span style='font-family:"Courier New"'><br>Filesystem      Size            Used          Avail          Use% Mounted on<o:p></o:p></span></p></div><p class=MsoNormal><span style='font-family:"Courier New"'>/dev/md4         651G          113G          507G          19% /</span><br><br>So df shows a value in KB (682587992). <br><br>The Nagios plugin itself takes this value and presents it in MB (666589):<br><br><span style='font-family:"Courier New"'>/=114709MB;533271;599930;0;666589</span><br><br>So in order to present Nagiosgraph the values, we have to go down to the lowest level, which in this case is Byte. <br>To get Byte value from the Nagios output we have to multiply it with 1024^2: 666589*1024*1024 = 698969227264<br><br>The job of Nagiosgraph is now to take this 698969227264 value and divide it so often through 1024 until a "reasonable" and human readable value is given, which would be the 651 GB. <br><br>But here's the problem: Nagiosgraph divides 698969227264 through 1000 instead of 1024, showing the graph at 698 GB. <br>But why? It took me some guesses which I had to confirm but: Nagiosgraph BY DEFAULT divides through 1000. Probably because the initial reason for rrd graphs was the graphing of network connections which are usually in bits. Anyhow we need to tell Nagiosgraph to divide through 1024 for our disk checks. <br>There's a special file for that called <b>rrdopts.conf</b>. I added the following lines to it:<br><br><span style='font-family:"Courier New"'># disk values need to be divided by 1024 not 1000<br>Diskspace /=-b 1024<br>Root Partition=-b 1024</span><br><br>The string left defines the service description in Nagios. So in my case this is "Diskspace /". -b 1024 tells Nagiosgraph to take 1024 as a base value.<br>See the following entry from the "rrdgraph" manpage:<o:p></o:p></p><p>[<b>-b</b>|<b>--base</b> <i>value</i>] If you are graphing memory (and <span style='font-size:10.0pt'>NOT</span> network traffic) this switch should be set to 1024 so that one Kb is 1024 byte. For traffic measurement, 1 kb/s is 1000 b/s. <o:p></o:p></p><p>Now you just have to make sure, that rrdopts.conf is not commented in your nagiosgraph.conf file and there you go. <o:p></o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>Positive thing is that there is no need to recreate the rrd files. This rrd option is only for viewing/drawing the graphs. Which means that the correct values are shown immediately. <br><br><br><o:p></o:p></p><div><p class=MsoNormal>On Tue, Dec 18, 2012 at 2:51 PM, James Osbourn <<a href="mailto:james.osbourn@citrix.com" target="_blank">james.osbourn@citrix.com</a>> wrote:<o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi Claudio,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I modified your code as it was not working for me and wanted to check what was going on.  I have reverted back to using the example that you have given and I am still getting the same result as can be seen here</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>The filesystem is only 450GB in size, yet the graph values are still showing 460.80, which is the byte value show in decimal GB.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I cannot work out why the graph is showing the wrong values when all other information is correct.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>James</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Claudio Kuenzler [mailto:<a href="mailto:ck@claudiokuenzler.com" target="_blank">ck@claudiokuenzler.com</a>] <br><b>Sent:</b> 18 December 2012 12:15</span><o:p></o:p></p><div><p class=MsoNormal><br><b>To:</b> Nagios Users List<br><b>Subject:</b> Re: [Nagios-users] Nagios Graph converting figures to binary bytes rather than decimal<o:p></o:p></p></div></div></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi Claudio,</span><o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I have entered the map entry below based on your example and I am still seeing the results on the graph show as a decimal version of the Bytes value.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Courier New";color:#1F497D'>/perfdata:(.*)=(\d+)MB;(\d+);(\d+);(\d+);(\d+)/</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Courier New";color:#1F497D'>and push @s, [$1,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Courier New";color:#1F497D'>        ['data', GAUGE, $2*1024*1024 ],</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Courier New";color:#1F497D'>        ['warn', GAUGE, $3*1024*1024 ],</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Courier New";color:#1F497D'>        ['crit', GAUGE, $4*1024*1024 ],</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Courier New";color:#1F497D'>        ['min', GAUGE, $5*1024*1024 ],</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Courier New";color:#1F497D'>        ['max', GAUGE, $6*1024*1024 ] ];</span><o:p></o:p></p></div></div></div></div></blockquote></div><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><br>You didn't follow my example, as you're again multiplying with 1024.<br><br>Take _another_ look at my example:<br><br>        ['used', GAUGE, $2*1000**2 ],<br>        ['total', GAUGE, $6*1000**2 ] ];<o:p></o:p></p></div></div></div></div></div><p class=MsoNormal><br>------------------------------------------------------------------------------<br>LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial<br>Remotely access PCs and mobile devices and provide instant support<br>Improve your efficiency, and focus on delivering more value-add services<br>Discover what IT Professionals Know. Rescue delivers<br><a href="http://p.sf.net/sfu/logmein_12329d2d" target="_blank">http://p.sf.net/sfu/logmein_12329d2d</a><br>_______________________________________________<br>Nagios-users mailing list<br><a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br><a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br>::: Messages without supporting info will risk being sent to /dev/null<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p></div></div></body></html>