⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 loggertemplate.tmpl

📁 Network Administration Visualized 网络管理可视化源码
💻 TMPL
字号:
#encoding UTF-8## $Id: MatrixTemplate.tmpl 2674 2004-04-28 13:03:41Z mortenv $#### Copyright 2003, 2004 Norwegian University of Science and Technology#### This file is part of Network Administration Visualized (NAV)#### NAV is free software; you can redistribute it and/or modify## it under the terms of the GNU General Public License as published by## the Free Software Foundation; either version 2 of the License, or## (at your option) any later version.#### NAV is distributed in the hope that it will be useful,## but WITHOUT ANY WARRANTY; without even the implied warranty of## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the## GNU General Public License for more details.#### You should have received a copy of the GNU General Public License## along with NAV; if not, write to the Free Software## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA###### Authors: Sigurd Gartmann <sigurd-nav@brogar.org>###extends nav.web.templates.MainTemplate#block content<h2>Syslog Analyzer</h2><div id="wrapper">$logform($priority,$type,$category,$origin,$tfrom,$tto)#if $mode == "statistics"$statistics($typelist, $originlist, $total, $typedict, $origindict, $type, $origin, $priority, $category, $link)#elif $mode == "log"$viewlog($log, $total, $type, $origin, $priority, $category)#elif $mode == "error"$errorlist($errors, $total)#elif $mode == "exception"$exceptionlist($exceptions)#else$prioritylist($priorities, $priorityresult, $link)#end if</div>#end block#def logform($priority,$type,$category,$origin,$tfrom,$tto)<div id="logform"><form action="" method="get"><label for="priority">Priority</label><select id="priority" name="priority">#for $p in $priorities#if str($p[0]) == str($priority)	<option value="$p[0]" selected="1">$p[1]</option>#else	<option value="$p[0]">$p[1]</option>#end if#end for</select><label for="type"><a href="http://www.cisco.com/univercd/cc/td/doc/product/software/ios120/12supdoc/12sems/emover.htm#5002">Message type</a></label><select id="type" name="type">#for $t in $types#if $t[1] == $type	<option value="$t[1]" selected="1">$t[1]</option>#else	<option value="$t[1]">$t[1]</option>#end if#end for</select><br /><label for="category">Category</label><select id="category" name="category">#for $c in $categories#if $c[0] == $category	<option value="$c[0]" selected="1">$c[0]</option>#else	<option value="$c[0]">$c[0]</option>#end if#end for</select><label for="origin">Origin</label><select id="origin" nameid="origin">#for $o in $origins#if $o[1] == $origin	<option value="$o[1]" selected="1">$o[1]</option>#else	<option value="$o[1]">$o[1]</option>#end if#end for</select><br /><label for="tfrom" title="yyyy-mm-dd HH:MM:SS">From</label><input type="text" name="tfrom" value="$tfrom" title="yyyy-mm-dd HH:MM:SS" size="19" maxlength="19" /><label for="tto" title="yyyy-mm-dd HH:MM:SS">To</label><input type="text" name="tto" value="$tto" title="yyyy-mm-dd HH:MM:SS" size="19" maxlength="19" /><br /><input type="submit" name="send" value="Send" /><input type="button" name="reset" value="Reset" onclick="window.location.href='/logger/'"/> - <a href="/logger/?error">parsing errors</a> - <a href="/logger/?exception">priority exceptions</a> -</form></div>#end def#def $prioritylist($pritorities, $priorityresult, $link)#if len($priorityresult)<table>#for $row in $priorities#if $priorityresult.has_key($row[0])<tr><td><a href="/logger/?$link&amp;priority=$row[0]" title="$row[2]">Priority $row[1]</a></td><td>$priorityresult[$row[0]]</td></tr>#elif not $row[0] == "-"<tr><td><span title="$row[2]">Priority $row[1]</span></td><td>0</td></tr>#end if#end for</table>#else<p>Your search did not return any results.</p>#end if#end def#def $statistics($typelist, $originlist, $total, $typedict, $origindict, $typeid, $originid, $priorityid, $categoryid, $link)<div style="text-align:center;width:100%"><p style="text-align:center;">Total $total matches#if $typeidof type $typeid#elif $priorityidof priority $priorityid#end if#if $originidfrom origin $originid#elif $categoryidof category $categoryid#end if</p><div style="float:left;text-align:left;">#if len($originlist)<table>#for $o in $originlist#if $originid == $origindict[$o[0]]<tr><td>$origindict[$o[0]]</td><td><a href="/logger/?$link&amp;log=1">$o[1]</a></td></tr>#else<tr><td><a href="/logger/?$link&amp;origin=$origindict[$o[0]]">$origindict[$o[0]]</a></td><td><a href="/logger/?$link&amp;origin=$origindict[$o[0]]&amp;log=1">$o[1]</a></td></tr>#end if#end for</table>#end if</div><div style="float:left;text-align:left;">#if len($typelist)<table>#for $t in $typelist#if $typeid == $typedict[$t[0]]<tr><td>$typedict[$t[0]]</td><td><a href="/logger/?$link&amp;log=1">$t[1]</a></td></tr>#else<tr><td><a href="/logger/?$link&amp;type=$typedict[$t[0]]">$typedict[$t[0]]</a></td><td><a href="/logger/?$link&amp;type=$typedict[$t[0]]&amp;log=1">$t[1]</a></td></tr>#end if#end for</table>#end if</div></div>#end def#def $viewlog($log, $total, $typeid, $originid, $priorityid, $categoryid)<p style="text-align:center;">Total $total matches#if $typeidof type $typeid#elif $priorityidof priority $priorityid#end if#if $originidfrom origin $originid#elif $categoryidof category $categoryid#end if</p>#if len($log)<table>#for $l in $log<tr><td>$l.time</td><td>$l.origin</td><td>$l.type</td><td>$l.message</td></tr>#end for</table>#end if#end def#def $errorlist($errors, $total)#if len($errors)<p style="text-align:center;">Total $total error conditions</p><table>#for $e in $errors<tr><td>$e[0]</td></tr>#end for</table>#else<p>There is not saved any error conditions from the parsing of the syslogfiles. This probably means all the log messages have been parsedsuccessfully.</p>#end if#end def#def $exceptionlist($exceptions)#if len($exceptions)<p>Lists your defined priority exceptions based on the logger.conf configuration file</p><table>#for $e in $exceptions<tr><td>$e[0]</td><td>$e[1]</td></tr>#end for</table>#else<p>You have not defined any priority exceptions in the logger.conf configuration file</p>#end if#end def

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -