<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style>
<!--
@font-face
        {font-family:"Cambria Math"}
@font-face
        {font-family:Calibri}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif"}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline}
span.EmailStyle17
        {font-family:"Calibri","sans-serif";
        color:windowtext}
@page WordSection1
        {margin:1.0in 1.0in 1.0in 1.0in}
-->
</style><style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1" lang="EN-US" link="blue" vlink="purple">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Looking at the code, clearly the open is failing (and the code doesnt check for it, naughty!) so you get the error.<br>
<br>
Check the HTMLdir to make sure the MRTg process has write permission to it, and if the .meta file already exists, check the write permission on that as well.<br>
<br>
Steve<br>
<div><br>
<div style="font-family: Tahoma; font-size: 13px;">
<div style="font-family: Tahoma; font-size: 13px;"><strong>Steve Shipway</strong></div>
<div style="font-family: Tahoma; font-size: 13px;">University of Auckland ITS</div>
<div style="font-family: Tahoma; font-size: 13px;"><em>UNIX Systems Design Lead</em></div>
<div style="font-family: Tahoma; font-size: 13px;"><a href="mailto:s.shipway@auckland.ac.nz">s.shipway@auckland.ac.nz</a></div>
<div style="font-family: Tahoma; font-size: 13px;">Ph: +64 9 373 7599 ext 86487</div>
<div style="font-family: Tahoma; font-size: 13px;"><em></em> </div>
</div>
</div>
<div style="font-family: Times New Roman; color: rgb(0, 0, 0); font-size: 16px;">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF768749"><font color="#000000" face="Tahoma" size="2"><b>From:</b> mrtg-bounces+s.shipway=auckland.ac.nz@lists.oetiker.ch [mrtg-bounces+s.shipway=auckland.ac.nz@lists.oetiker.ch] on behalf of Grossman, Benjamin [Benjamin.Grossman@kingcounty.gov]<br>
<b>Sent:</b> Saturday, 18 June 2011 6:35 a.m.<br>
<b>To:</b> mrtg@lists.oetiker.ch<br>
<b>Subject:</b> [mrtg] writeexpires killing rateup?<br>
</font><br>
</div>
<div></div>
<div>
<div class="WordSection1">
<p class="MsoNormal">Migrating from Solaris 10 to Red Hat Enterprise 6
</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I keep getting:</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">print() on closed filehandle META at /usr/bin/mrtg line 396.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">
in the log.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">This is MRTG 2.16.2, installed as a package.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">mrtg @ line 396 is: </p>
<p class="MsoNormal"> # set meta expires if there is an index file</p>
<p class="MsoNormal"> # 2000/05/03 Bill McGonigle <bill@zettabyte.net></p>
<p class="MsoNormal"> if (defined $cfg{'writeexpires'}) {</p>
<p class="MsoNormal"> my $exp = &expistr($cfg{'interval'});</p>
<p class="MsoNormal"> my $fil;</p>
<p class="MsoNormal"> $fil = "$cfg{'htmldir'}index.html" if -e "$cfg{'htmldir'}index.html";</p>
<p class="MsoNormal"> $fil = "$cfg{'htmldir'}index.htm" if -e "$cfg{'htmldir'}index.htm";</p>
<p class="MsoNormal"> if (defined $fil) {</p>
<p class="MsoNormal"> open(META, ">$fil.meta");</p>
<p class="MsoNormal"> print META "Expires: $exp\n";</p>
<p class="MsoNormal"> close(META);</p>
<p class="MsoNormal"> }</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Any ideas what the problem is?</p>
<p class="MsoNormal">mrtg runs from cron as a member of group=users; files in Working Directory look like:</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">[bkg@net-counts log]$ ls -al /var/www/mrtg/inet/switch/ia-isp-ksc</p>
<p class="MsoNormal">total 768</p>
<p class="MsoNormal">drwxr-xr-x. 2 apache apache 4096 Jun 13 13:28 .</p>
<p class="MsoNormal">drwxr-xr-x. 165 apache apache 4096 Jun 9 00:07 ..</p>
<p class="MsoNormal">-rwxrwxr-x. 1 apache users 2064 Jun 13 13:28 ia-isp-ksc.inet.networks.lcl_4718644-day.png</p>
<p class="MsoNormal">-rwxrwxr-x. 1 apache users 39 Jun 13 13:28 ia-isp-ksc.inet.networks.lcl_4718644-day.png.meta</p>
<p class="MsoNormal">-rwxrwxr-x. 1 apache users 2457 Jun 13 12:28 ia-isp-ksc.inet.networks.lcl_4718644-month.png</p>
<p class="MsoNormal">-rwxrwxr-x. 1 apache users 39 Jun 13 12:28 ia-isp-ksc.inet.networks.lcl_4718644-month.png.meta</p>
<p class="MsoNormal">-rwxrwxr-x. 1 apache users 3067 Jun 13 12:58 ia-isp-ksc.inet.networks.lcl_4718644-week.png</p>
<p class="MsoNormal">-rwxrwxr-x. 1 apache users 39 Jun 13 12:58 ia-isp-ksc.inet.networks.lcl_4718644-week.png.meta</p>
<p class="MsoNormal">-rwxrwxr-x. 1 apache users 2423 Jun 13 10:18 ia-isp-ksc.inet.networks.lcl_4718644-year.png</p>
<p class="MsoNormal">-rwxrwxr-x. 1 apache users 39 Jun 13 10:18 ia-isp-ksc.inet.networks.lcl_4718644-year.png.meta</p>
<p class="MsoNormal">-rwxrwxr-x. 1 apache users 8321 Jun 13 13:28 ia-isp-ksc.inet.networks.lcl_4718644.html</p>
<p class="MsoNormal">-rwxrwxr-x. 1 apache users 39 Jun 13 13:28 ia-isp-ksc.inet.networks.lcl_4718644.html.meta</p>
<p class="MsoNormal">-rwxrwxr-x. 1 apache users 68601 Jun 13 13:28 ia-isp-ksc.inet.networks.lcl_4718644.log</p>
<p class="MsoNormal">-rwxrwxr-x. 1 apache users 68601 Jun 13 13:23 ia-isp-ksc.inet.networks.lcl_4718644.old</p>
<p class="MsoNormal">
</p>
<p class="MsoNormal">-rwxrwxr-x. 1 apache users 1823 Jun 13 13:28 ia-isp-ksc.inet.networks.lcl_cpu-day.png</p>
<p class="MsoNormal">-rwxrwxr-x. 1 apache users 39 Jun 13 13:28 ia-isp-ksc.inet.networks.lcl_cpu-day.png.meta</p>
<p class="MsoNormal">-rwxrwxr-x. 1 apache users 2017 Jun 13 12:38 ia-isp-ksc.inet.networks.lcl_cpu-month.png</p>
<p class="MsoNormal">-rwxrwxr-x. 1 apache users 39 Jun 13 12:38 ia-isp-ksc.inet.networks.lcl_cpu-month.png.meta</p>
<p class="MsoNormal">-rwxrwxr-x. 1 apache users 2226 Jun 13 12:58 ia-isp-ksc.inet.networks.lcl_cpu-week.png</p>
<p class="MsoNormal">-rwxrwxr-x. 1 apache users 39 Jun 13 12:58 ia-isp-ksc.inet.networks.lcl_cpu-week.png.meta</p>
<p class="MsoNormal">-rwxrwxr-x. 1 apache users 2140 Jun 13 10:18 ia-isp-ksc.inet.networks.lcl_cpu-year.png</p>
<p class="MsoNormal">-rwxrwxr-x. 1 apache users 39 Jun 13 10:18 ia-isp-ksc.inet.networks.lcl_cpu-year.png.meta</p>
<p class="MsoNormal">-rwxrwxr-x. 1 apache users 7952 Jun 13 13:28 ia-isp-ksc.inet.networks.lcl_cpu.html</p>
<p class="MsoNormal">-rwxrwxr-x. 1 apache users 39 Jun 13 13:28 ia-isp-ksc.inet.networks.lcl_cpu.html.meta</p>
<p class="MsoNormal">-rwxrwxr-x. 1 apache users 52910 Jun 13 13:28 ia-isp-ksc.inet.networks.lcl_cpu.log</p>
<p class="MsoNormal">-rwxrwxr-x. 1 apache users 52910 Jun 13 13:23 ia-isp-ksc.inet.networks.lcl_cpu.old</p>
<p class="MsoNormal">-rwxrwxr-x. 1 apache users 6687 Jun 15 13:47 index.html</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Config file looks like:</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">WithPeak[_]: wmy</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Include: /opt/local/site/bin/mrtg-header.conf</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">PageFoot[_]: <HR>Page Design last modified on 16-jan-08 -- <A HREF=http://mrtg.metrokc.gov/mrtg/inet-switch-history.html>"Change History"</A><HR></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">AddHead[^]:\n</p>
<p class="MsoNormal"><table cellspacing="0" border="0" cellpadding="0" width="100%" style="border-collapse: collapse" bordercolor="#111111">\n</p>
<p class="MsoNormal"> <tr>\n</p>
<p class="MsoNormal"> <td width="20%" valign="top" rowspan="2"><img src="Homelogo2.gif" align="left" /></p></td>\n</p>
<p class="MsoNormal"> <td width="60%" valign="top"><p><h1 align="center">Network Tools</h1></p></td>\n</p>
<p class="MsoNormal"> <td width="20%" valign="top" rowspan="2"><img src="mrtg_logo.gif" align="right" /></td>\n</p>
<p class="MsoNormal"> </tr>\n</p>
<p class="MsoNormal"> <tr>\n</p>
<p class="MsoNormal"> <td width="500" valign="bottom" height="53">\n</p>
<p class="MsoNormal"> <p align="center"><font color="#FF8000" size="2"><strong>CAUTION</strong>: This is primarily for use by King County Network Engineers. </font></p>\n</p>
<p class="MsoNormal"> <p align="center"><a href="http://net-counts/mrtg">KC MRTG Home</a>| <a href="http://quickstart.inet.networks.lcl/quickstart.htm">QuickStart Home</a> | <a href="mailto:benjamin.grossman@kingcounty.gov">Feedback</a> </p></td>\n</p>
<p class="MsoNormal"> </tr>\n</p>
<p class="MsoNormal"></table>\n</p>
<p class="MsoNormal"> <HR>\n</p>
<p class="MsoNormal"> <H3><FONT color=#663300>About KC Network's MRTG monitoring tool:</H3>\n</p>
<p class="MsoNormal"> <H4><b>UNDERSTANDING:</b> Data presented below is based on a 5 minute polling cycle. Please see <A HREF=http://net-counts/mrtg/notes.html>MRTG Notes</A> for more details.</H4><p>\n</p>
<p class="MsoNormal"> </FONT>\n</p>
<p class="MsoNormal"> <HR></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"># Created by</p>
<p class="MsoNormal"># /usr/bin/cfgmaker2 --ifdesc=name --global IconDir:/mrtg/ --global WorkDir:/var/www/html/mrtg/inet/switch --global WriteExpires:yes --global "Options[_]:growright,bits,pngdate,printrouter" --subdirs=ia-isp-ksc --community=FullMotionVide</p>
<p class="MsoNormal">o --dns-domain=inet.networks.lcl "--if-filter=$if_oper && $if_index>100 && $if_type!=39 && $if_type!=50 && $if_type!=61 && $if_port_name ne "1CTL" && $if_port_name ne "5CTL" && $if_port_name ne "1ACTL" && $if_port_name ne "1BCTL"</p>
<p class="MsoNormal"> && $if_port_name ne "1CCTL" && $if_port_name ne "1DCTL" " --if-template=/opt/local/site/bin/marconi-if.template --host-template=/opt/local/site/bin/marconi-host.template --output=46754devicetemp ia-isp-ksc</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">### Global Config Options</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"># for UNIX</p>
<p class="MsoNormal"># WorkDir: /home/http/mrtg</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"># or for NT</p>
<p class="MsoNormal"># WorkDir: c:\mrtgdata</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">### Global Defaults</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"># to get bits instead of bytes and graphs growing to the right</p>
<p class="MsoNormal"># Options[_]: growright, bits</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">EnableIPv6: no</p>
<p class="MsoNormal">IconDir:/mrtg/</p>
<p class="MsoNormal">WorkDir:/var/www/html/mrtg/inet/switch</p>
<p class="MsoNormal">WriteExpires:yes</p>
<p class="MsoNormal">Options[_]:growright,bits,pngdate,printrouter</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">######################################################################</p>
<p class="MsoNormal"># System: ia-isp-ksc</p>
<p class="MsoNormal"># Description: Marconi ASX-200BX</p>
<p class="MsoNormal"># Contact: I-Net NOC 206/263-7000</p>
<p class="MsoNormal"># Location: a#218732 s#437556</p>
<p class="MsoNormal">######################################################################</p>
<p class="MsoNormal">#-------------------------------------------------------------</p>
<p class="MsoNormal"># 1.003 10-oct-07 BkG work on PageTop</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Target[ia-isp-ksc.inet.networks.lcl_CPU]: 1.3.6.1.4.1.326.2.2.1.1.1.3.1.2.0&1.3.6.1.4.1.326.2.2.1.1.1.3.1.6.0:xxxxxxxxxxxxx@ia-isp-ksc</p>
<p class="MsoNormal">SetEnv[ia-isp-ksc.inet.networks.lcl_CPU]: MRTG_INT_IP="" MRTG_INT_DESCR=""</p>
<p class="MsoNormal">Directory[ia-isp-ksc.inet.networks.lcl_CPU]: ia-isp-ksc</p>
<p class="MsoNormal">MaxBytes[ia-isp-ksc.inet.networks.lcl_CPU]: 100</p>
<p class="MsoNormal">Unscaled[ia-isp-ksc.inet.networks.lcl_CPU]: dwmy</p>
<p class="MsoNormal">Title[ia-isp-ksc.inet.networks.lcl_CPU]: ia-isp-ksc.inet.networks.lcl CPU load</p>
<p class="MsoNormal">YLegend[ia-isp-ksc.inet.networks.lcl_CPU]: Percentage CPU Load</p>
<p class="MsoNormal">ShortLegend[ia-isp-ksc.inet.networks.lcl_CPU]: %</p>
<p class="MsoNormal">Legend1[ia-isp-ksc.inet.networks.lcl_CPU]: CPU load in %</p>
<p class="MsoNormal">Legend2[ia-isp-ksc.inet.networks.lcl_CPU]: Max CPU load in %</p>
<p class="MsoNormal">Legend3[ia-isp-ksc.inet.networks.lcl_CPU]: Peak Observed CPU load</p>
<p class="MsoNormal">Legend4[ia-isp-ksc.inet.networks.lcl_CPU]: Peak Reported Max CPU load</p>
<p class="MsoNormal">LegendI[ia-isp-ksc.inet.networks.lcl_CPU]: &nbsp;CPU Load:</p>
<p class="MsoNormal">LegendO[ia-isp-ksc.inet.networks.lcl_CPU]: &nbsp;Max CPU Load:</p>
<p class="MsoNormal">WithPeak[ia-isp-ksc.inet.networks.lcl_CPU]: ywm</p>
<p class="MsoNormal">Options[ia-isp-ksc.inet.networks.lcl_CPU]: growright,gauge,nopercent,pngdate,printrouter</p>
<p class="MsoNormal">PageTop[ia-isp-ksc.inet.networks.lcl_CPU]: <H1>ia-isp-ksc.inet.networks.lcl -- CPU</H1></p>
<p class="MsoNormal"> <TABLE></p>
<p class="MsoNormal"> <TR><TD>System:</TD><TD>ia-isp-ksc.inet.networks.lcl in a#218732 s#437556</TD></TR></p>
<p class="MsoNormal"> <TR><TD>OS:</TD> <TD>9.2.0.188602</TD></TR></p>
<p class="MsoNormal"> <TR><TD>Maintainer:</TD><TD>I-Net NOC 206/263-7000</TD></TR></p>
<p class="MsoNormal"> <TR><TD VALING="top">Description:</TD><TD>ia-isp-kscMarconi ASX-200BX</TD></TR></p>
<p class="MsoNormal"> <TR><TD>Port Name:</TD><TD>CPU</TD></TR></p>
<p class="MsoNormal"> </TABLE></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">### Interface 4718644 >> Descr: 'Ethernet-Interface' | Name: '1B1' | Ip: '' | Eth: '' ###</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Target[ia-isp-ksc.inet.networks.lcl_4718644]: 4718644:xxxxxxxx@ia-isp-ksc:</p>
<p class="MsoNormal">SetEnv[ia-isp-ksc.inet.networks.lcl_4718644]: MRTG_INT_IP="" MRTG_INT_DESCR="Ethernet-Interface"</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Directory[ia-isp-ksc.inet.networks.lcl_4718644]: ia-isp-ksc</p>
<p class="MsoNormal">MaxBytes[ia-isp-ksc.inet.networks.lcl_4718644]: 125000000</p>
<p class="MsoNormal">Title[ia-isp-ksc.inet.networks.lcl_4718644]: -- ia-isp-ksc.inet.networks.lcl</p>
<p class="MsoNormal">PageTop[ia-isp-ksc.inet.networks.lcl_4718644]: <H1> -- ia-isp-ksc</H1></p>
<p class="MsoNormal"><TABLE></p>
<p class="MsoNormal"> <TR><TD>System:</TD> <TD>ia-isp-ksc at a#218732 s#437556</TD></TR></p>
<p class="MsoNormal"> <TR><TD>OS:</TD> <TD>ForeThought 9.2.0.188602</TD></TR></p>
<p class="MsoNormal"> <TR><TD>Maintainer:</TD> <TD>I-Net NOC 206/263-7000</TD></TR></p>
<p class="MsoNormal"> <TR><TD>ifType:</TD> <TD>ethernetCsmacd (6)</TD></TR></p>
<p class="MsoNormal"> <TR><TD>Port Name:</TD> <TD></TD></TR></p>
<p class="MsoNormal"> <TR><TD>Max Thruput:</TD> <TD>1000.0 Mbits/s</TD></TR></p>
<p class="MsoNormal"></TABLE></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">### Interface 5046271 >> Descr: '' | Name: '1BCTL' | Ip: '' | Eth: '45-00-01-20-62-63-70-00-ff-00-00-2c-20-00-20-48-0d-00-08-00' ###</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Target[ia-isp-ksc.inet.networks.lcl_5046271]: 1.3.6.1.4.1.326.2.2.2.1.2.2.1.12.aaa-&1.3.6.1.4.1.326.2.2.2.1.2.2.1.18.aaa-:xxxxxxx@ia-isp-ksc: *53</p>
<p class="MsoNormal">SetEnv[ia-isp-ksc.inet.networks.lcl_5046271]: MRTG_INT_IP="" MRTG_INT_DESCR=""</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Directory[ia-isp-ksc.inet.networks.lcl_5046271]: ia-isp-ksc</p>
<p class="MsoNormal">MaxBytes[ia-isp-ksc.inet.networks.lcl_5046271]: 73375055</p>
<p class="MsoNormal">Title[ia-isp-ksc.inet.networks.lcl_5046271]: -- ia-isp-ksc.inet.networks.lcl</p>
<p class="MsoNormal">PageTop[ia-isp-ksc.inet.networks.lcl_5046271]: <H1> -- ia-isp-ksc</H1></p>
<p class="MsoNormal"><TABLE></p>
<p class="MsoNormal"> <TR><TD>System:</TD> <TD>ia-isp-ksc at a#218732 s#437556</TD></TR></p>
<p class="MsoNormal"> <TR><TD>OS:</TD> <TD>ForeThought 9.2.0.188602</TD></TR></p>
<p class="MsoNormal"> <TR><TD>Maintainer:</TD> <TD>I-Net NOC 206/263-7000</TD></TR></p>
<p class="MsoNormal"> <TR><TD>ifType:</TD> <TD>atm (37)</TD></TR></p>
<p class="MsoNormal"> <TR><TD>Port Name:</TD> <TD></TD></TR></p>
<p class="MsoNormal"> <TR><TD>Max Thruput:</TD> <TD>587.0 Mbits/s</TD></TR></p>
<p class="MsoNormal"></TABLE></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal" style=""><b><span style="font-family: "Arial","sans-serif"; color: teal;">Benjamin k Grossman</span></b><span style="font-size: 10pt; font-family: "Arial","sans-serif";"></span></p>
<p class="MsoNormal" style=""><i><span style="font-size: 10pt; font-family: "Arial","sans-serif";">I-Net Network Engineering ~
</span></i><span style="font-size: 10pt; font-family: "Arial","sans-serif";">King County IT ~ http://www.kingcounty.gov/business/oirm/inet.aspx</span>
</p>
<p class="MsoNormal"> </p>
</div>
</div>
</div>
</div>
</body>
</html>