<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Need help building Dashboard widget that displays Log file]]></title><description><![CDATA[<p dir="auto">I need a widget that displays the last 5 lines of a text logfile that is made from a bash script. The output of this script to the logfile is quite simple:</p>
<p dir="auto">Tue Jan  1 04:29:43 MST 2013 4.2.2.2 Ping FAILED<br />
Tue Jan  1 04:29:56 MST 2013 8.8.8.8 Ping FAILED<br />
Tue Jan  1 04:30:09 MST 2013 8.8.4.4 Ping FAILED<br />
Tue Jan  1 04:30:11 MST 2013 ALL PINGS FAILED<br />
Tue Jan  1 04:30:11 MST 2013 REQUESTING REBOOT…<br />
Tue Jan  1 04:30:11 MST 2013 DSL MODEM REBOOTING!</p>
<p dir="auto">I can get this in a shell with  tail -5 /var/logfile.log  but I'm not sure how to do this in a widget format.</p>
<p dir="auto">Thank you</p>
]]></description><link>https://forum.netgate.com/topic/51555/need-help-building-dashboard-widget-that-displays-log-file</link><generator>RSS for Node</generator><lastBuildDate>Tue, 17 Nov 2026 05:20:03 GMT</lastBuildDate><atom:link href="https://forum.netgate.com/topic/51555.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 02 Jan 2013 15:34:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Need help building Dashboard widget that displays Log file on Tue, 08 Jan 2013 14:38:52 GMT]]></title><description><![CDATA[<p dir="auto">Very good, nice and simple :-)</p>
<p dir="auto">Eventually we'll probably have a general-purpose log widget that lets someone choose any of the files in /var/log to show in a widget. Shouldn't be too hard to do, but it's one of those things that nobody has thought to take the time for yet.</p>
]]></description><link>https://forum.netgate.com/post/371561</link><guid isPermaLink="true">https://forum.netgate.com/post/371561</guid><dc:creator><![CDATA[jimp]]></dc:creator><pubDate>Tue, 08 Jan 2013 14:38:52 GMT</pubDate></item><item><title><![CDATA[Reply to Need help building Dashboard widget that displays Log file on Tue, 08 Jan 2013 03:19:42 GMT]]></title><description><![CDATA[<p dir="auto">Thank you. I looked at the code for those widgets and learned how to make my own. It is quite simple:</p>
<pre><code>
$file = "/var/log/DSLModemUptimeMonitor.log";
$contents = file($file);
$string = array_slice($contents,-6);
$string1 = array_reverse($string);

?&gt;

| 
                        # havp version
              echo implode("
", $string1);
          ?&gt;
         |

</code></pre>
]]></description><link>https://forum.netgate.com/post/371446</link><guid isPermaLink="true">https://forum.netgate.com/post/371446</guid><dc:creator><![CDATA[Kruzekova]]></dc:creator><pubDate>Tue, 08 Jan 2013 03:19:42 GMT</pubDate></item><item><title><![CDATA[Reply to Need help building Dashboard widget that displays Log file on Mon, 07 Jan 2013 14:14:51 GMT]]></title><description><![CDATA[<p dir="auto">There are several widgets that display logs, some more complex than others. Have a look at the snort widget (in packages), havp widget (also in packages), and firewall logs widget.</p>
<p dir="auto">What you're after would be easier than those, they do a bit of parsing before displaying, but you could perhaps use them as a basis for what you're trying to accomplish.</p>
<p dir="auto">Or at least to see how widgets work in general.</p>
]]></description><link>https://forum.netgate.com/post/371291</link><guid isPermaLink="true">https://forum.netgate.com/post/371291</guid><dc:creator><![CDATA[jimp]]></dc:creator><pubDate>Mon, 07 Jan 2013 14:14:51 GMT</pubDate></item></channel></rss>