<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:x="urn:schemas-microsoft-com:office:excel" 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 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
mso-add-space:auto;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
p.MsoNormalCxSpFirst, li.MsoNormalCxSpFirst, div.MsoNormalCxSpFirst
{mso-style-type:export-only;
margin:0cm;
margin-bottom:.0001pt;
mso-add-space:auto;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
p.MsoNormalCxSpMiddle, li.MsoNormalCxSpMiddle, div.MsoNormalCxSpMiddle
{mso-style-type:export-only;
margin:0cm;
margin-bottom:.0001pt;
mso-add-space:auto;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
p.MsoNormalCxSpLast, li.MsoNormalCxSpLast, div.MsoNormalCxSpLast
{mso-style-type:export-only;
margin:0cm;
margin-bottom:.0001pt;
mso-add-space:auto;
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;}
tt
{mso-style-priority:99;
font-family:"Courier New";}
span.EmailStyle15
{mso-style-type:personal;
font-family:"Arial",sans-serif;
color:#00007F;}
span.EmailStyle16
{mso-style-type:personal-compose;
font-family:"Arial",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
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=MsoNormalCxSpFirst><span style='font-size:10.0pt;font-family:"Arial",sans-serif'>Hello<o:p></o:p></span></p><p class=MsoNormalCxSpMiddle><span style='font-size:10.0pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p><p class=MsoNormalCxSpMiddle><span style='font-size:10.0pt;font-family:"Arial",sans-serif'>I can see that graphing uptime is possible, as you can see here:<o:p></o:p></span></p><p class=MsoNormalCxSpMiddle><span style='font-size:10.0pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p><p class=MsoNormalCxSpMiddle><span style='font-size:10.0pt;font-family:"Arial",sans-serif'><a href="http://www.hotelsvillegia.com/mrtg/uptime.html">http://www.hotelsvillegia.com/mrtg/uptime.html</a><o:p></o:p></span></p><p class=MsoNormalCxSpMiddle><span style='font-size:10.0pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p><p class=MsoNormalCxSpMiddle><span style='font-size:10.0pt;font-family:"Arial",sans-serif'>The HTML pages report uptime in the format: “163 days, 21:07:10”<o:p></o:p></span></p><p class=MsoNormalCxSpMiddle><span style='font-size:10.0pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p><p class=MsoNormalCxSpMiddle><span style='font-size:10.0pt;font-family:"Arial",sans-serif'>If I check manually, I get this:<o:p></o:p></span></p><p class=MsoNormalCxSpMiddle><span style='font-size:10.0pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p><p class=MsoNormalCxSpMiddle><span style='font-size:10.0pt;font-family:"Arial",sans-serif'>snmpget -v2c -c somecommunity somehost 1.3.6.1.2.1.1.3.0<o:p></o:p></span></p><p class=MsoNormalCxSpMiddle><span style='font-size:10.0pt;font-family:"Arial",sans-serif'>DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (1415941565) 163 days, 21:10:15.65<o:p></o:p></span></p><p class=MsoNormalCxSpMiddle><span style='font-size:10.0pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p><p class=MsoNormalCxSpMiddle><span style='font-size:10.0pt;font-family:"Arial",sans-serif'>The format is almost the same, but the latter contains the full centisecond accuracy. You do nonetheless get the raw number included.<o:p></o:p></span></p><p class=MsoNormalCxSpMiddle><span style='font-size:10.0pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p><p class=MsoNormalCxSpMiddle><span style='font-size:10.0pt;font-family:"Arial",sans-serif'>Now, using this in MRTG yields:<o:p></o:p></span></p><p class=MsoNormalCxSpMiddle><span style='font-size:10.0pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p><p class=MsoNormalCxSpMiddle><span style='font-size:10.0pt;font-family:"Arial",sans-serif'>2018-09-27 19:56:04 -- 2018-09-27 19:51:33: WARNING: Expected a number but got '163 days, 7:17:10'<o:p></o:p></span></p><p class=MsoNormalCxSpMiddle><span style='font-size:10.0pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p><p class=MsoNormalCxSpMiddle><span style='font-size:10.0pt;font-family:"Arial",sans-serif'>Looking at the source code, I cannot determine quite how uptime is processed. It seems odd that the format is almost the same (without the centiseconds), which suggests (along with other code) that MRTG receives pre-formatted output, and then has to scrape out the useful bits. (Which is just plain horrible if this is true.)<o:p></o:p></span></p><p class=MsoNormalCxSpMiddle><span style='font-size:10.0pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p><p class=MsoNormalCxSpMiddle><span style='font-size:10.0pt;font-family:"Arial",sans-serif'>Am I right in thinking that MRTG presently has no way to extract the raw figure here? It seems that the SNMP library is formatting the data prematurely and MRTG just works with that preformatted value as it suits its own purposes, but that you cannot get the raw data out if you choose, for example if you want to record uptime as a graph for checking for reboots.<o:p></o:p></span></p><p class=MsoNormalCxSpMiddle><span style='font-size:10.0pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p><p class=MsoNormalCxSpMiddle><span style='font-size:10.0pt;font-family:"Arial",sans-serif'>In the example posted, I suspect that was bodged to get that to work.<o:p></o:p></span></p><p class=MsoNormalCxSpMiddle><span style='font-size:10.0pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p><p class=MsoNormalCxSpMiddle><span style='font-size:10.0pt;font-family:"Arial",sans-serif'>Regards<o:p></o:p></span></p><p class=MsoNormalCxSpMiddle><span style='font-size:10.0pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p><p class=MsoNormalCxSpLast><span style='font-size:10.0pt;font-family:"Arial",sans-serif'>Daniel. <o:p></o:p></span></p></div></body></html>