File: 1.00.6a/server/base/ (View as HTML)

  1: <?php //
  2: /* -------------------------------------------------------------
  3: This file is part of FreeNATS
  5: FreeNATS is (C) Copyright 2008 PurplePixie Systems
  7: FreeNATS is free software: you can redistribute it and/or modify
  8: it under the terms of the GNU General Public License as published by
  9: the Free Software Foundation, either version 3 of the License, or
 10: (at your option) any later version.
 12: FreeNATS is distributed in the hope that it will be useful,
 13: but WITHOUT ANY WARRANTY; without even the implied warranty of
 15: GNU General Public License for more details.
 17: You should have received a copy of the GNU General Public License
 18: along with FreeNATS.  If not, see
 20: For more information see
 21: -------------------------------------------------------------- */
 23: $NATS_Help=array();
 25: function ha($id,$text)
 26: {
 27: global $NATS_Help;
 28: $NATS_Help[strtoupper($id)]=$text;
 29: }
 31: ha("FreeNATS","FreeNATS is a network monitoring package");
 33: ha("Node","A node is a system or device which you are monitoring. Note that nodes can have tests pointing to different physical devices and vice-versa");
 34: ha("Node:Create","Create a new {node} with this {node:id|NodeID}");
 35: ha("Node:ID","The NodeID is a unique text name for a {node}. Maximum length 60 chars and only normal characters allowed.");
 36: ha("Node:Enabled","The node is enabled for tests to be performed (and displayed in all applicable views)");
 37: ha("Node:AlertActive","Alerts will be generated for this node and alert actions performed if selected");
 38: ha("Node:PingTest","Do a ping (ICMP) test first before other tests - will always record results if enabled");
 39: ha("Node:RequirePing","Require the ping to pass for other tests to even be tried - will always fail if {Node:PingTest|ping test} is disabled");
 41: ha("Group","A group is a collection of one or more {node|nodes}. Note that nodes can be members of more than one group.");
 42: ha("Group:Create","Create a new {group} with this name");
 44: ha("Test:Name","A custom name can be assigned to the test for use in displays and alerts. If blank an automated name will be generated.");
 45: ha("Test:Attempts","Number of times to attempt a test (will always try once). Defaults to 1 if zero or unset.");
 46: ha("Test:Timeout","Timeout value for the test - alters the defaults or system-wide variable settings for the relevant test (seconds)");
 47: ha("Test:SimpleEvaluation","Use simple pass/fail evaluation (i.e. if a web test returns any data it passes else it fails)");
 48: ha("Test:Recorded","Record the results of this test for historic reports");
 49: ha("Test:Enabled","Perform the test or not (will update nothing if disabled)");
 51: ha("History:Should","A rough calculation based on 5 minute polling from the start to finish (or now if sooner)");
 53: ha("View","A view is a custom set of nodes/groups/tests which can be used in a variety of ways");
 54: ha("View:Create","Creates a {view} of the specified name");
 55: ha("View:Public","The view can be seen by people not logged into FreeNATS");
 56: ha("View:Colons","If text status is selected for a view item a colon will be displayed before it");
 57: ha("View:Dashes","Display a dash before a test last run time where applicable");
 58: ha("View:TimeAgo","Use XX:XX ago or normal datetime for test details");
 59: ha("View:Columns","Display list-type elements in this number of columns (0 for off)");
 60: ha("View:Refresh","Send a http-equv to refresh the page after this many seconds (0 for off)");
 61: ha("View:UseColour","Use colour for status display as in normal FreeNATS display");
 62: ha("View:ShowDetail","Show details of the test/object(s) such as node tests");
 63: ha("View:TextStatus","Textual status such as passed, failed etc");
 65: ha("Report","Reports show the %age of service availability in a specified period");
 67: ha("Schedule","A schedule controls what times a node is tested and are managed through the admin page");
 68: ha("Schedule:DefaultAction","What will happen if no exceptions are matched (the opposite will happen if one is matched)");
 70: ha("AlertAction","An alert action is performed when a node fails a test, they are configured through the admin page");
 71: ha("AAction:Warnings","The action is triggered for warning level events as well as failures (including downgrading from failure to warning if {AAction:Decreases|decreases} is set)");
 72: ha("AAction:Decreases","The action is triggered when the level goes down to closed (or {AAction:Warnings|warnings} if set)");
 73: ha("AAction:Limit","Max times this action can run in any one day (0 = unlimited) to avoid flooding");
 74: ha("AAction:Counter","Number of times this action has run in the day shown - you can manually reset this here");
 76: ha("Variable","System variables are used to control the system environment. To delete a variable just save it with a blank name.");
 77: ha("Var:log.level","The system log level - 10 is everything, 0 is fatal only. 5-6-ish is probably a good balance.");
 79: ha("Var:api.public","The API interface is available to public users if 1 (also see {Var:api.key|api.key})");
 80: ha("Var:api.key","Require this key from public users as apikey when accessing the API ({Var:api.public|api.public} must be set)");
 82: ha("Var:site.graph.public","Graphs are available to public users for views etc if 1 (also see {Var:site.graph.key|site.graph.key})");
 83: ha("Var:site.graph.key","Require this key from public users as graphkey ({Var:site.graph.public|site.graph.public} must be set)");
 85: ha("Var:site.enable.interactive","Must be set (1) to allow interactive web sessions (like this one)");
 86: ha("Var:site.popupmessage","If set (1) will show a popup message when saving changes etc");
 87: ha("Var:site.dtformat","Site-wide custom date time format (in PHP format) i.e. Y-m-d H:i:s");
 89: ha("Var:site.text.failed","Text to show for a failed status (defaults to Failed if unset)");
 90: ha("Var:site.text.passed","Text to show for a passed status (defaults to Passed if unset)");
 91: ha("Var:site.text.untested","Text to show for untested items (defaults to Untested if unset)");
 92: ha("Var:site.text.warning","Text to show for a warning status (defaults to Warning if unset)");
 93: ha("","Include *.php in the server/site/events directory if 1");
 94: ha("Var:site.include.tests","Include *.php in the server/site/tests directory if 1");
 95: ha("Var:site.enable.adminsql","Enables the admin SQL console if 1");
 97: ha("Var:mail.fromname","Textual from name to be used in SMTP mail (defaults to FreeNATS if unset)");
 98: ha("Var:mail.smtpserver","SMTP server to relay mail through (can be ; seperated list) uses internal mail() if unset or blank");
 99: ha("Var:mail.smtpusername","Username for SMTP AUTH (AUTH only used if username is set or provided)");
100: ha("Var:mail.smtppassword","Password for SMTP AUTH");
101: ha("Var:mail.smtphostname","Hostname for HELO in SMTP transactions (may be required for strict mail servers)");
103: ha("Var:test.icmp.timeout","Timeout in seconds to wait for an ICMP response before declaring a failure in seconds (default 10)");
104: ha("Var:test.icmp.trytwice","Depreciated - replaced with {Var:test.icmp.attempts|test.icmp.attempts}");
105: ha("Var:test.icmp.attempts","Number of times the main &quot;require ping&quot; test will attempt before failing (default 2)");
106: ha("Var:test.icmp.returnms","If set (1) returns ping results in MilliSeconds (ms) (default 0)");
107: ha("Var:test.http.timeout","Default timeout for HTTP/s streams used in web tests (uses system default if unset or &lt;1)");
108: ha("Var:test.imap.timeout","Default timeout for IMAP tests in seconds (uses environment default if unset or 0)");
109: ha("Var:test.smtp.timeout","Default timeout for SMTP tests in seconds (uses 20 seconds if 0 or unset)");
110: ha("Var:test.mysql.timeout","Default timeout for MySQL tests in seconds (uses environmental default if unset or 0)");
111: ha("Var:test.spawndelay","Delay in seconds between node test threads being spawned by (no delay if 0 or unset), can be a decimal");
112: ha("Var:test.interval","Delay in seconds between tests on a node (no delay if 0 or unset), can be a decimal");
115: ha("Var:retain.alert","Days to retain alert records for (default 356 if 0 or unset). Retain forever with value -1.");
116: ha("Var:retain.record","Days to retain test result records for use in history and graphs (default 356 if 0 or unsert). Retain forever with value -1.");
117: ha("Var:retain.testrun","Days to retain test run records for (default 30 if 0 or unset). Retain forever with value -1.");
118: ha("Var:retain.syslog","Days to retain log entries for (default 30 if 0 or unset). Retain forever with value -1.");
120: ha("Var:freenats.tracker","Participate in the automated feedback process - 1 for yes low level, 2 for detailed, 0 for disabled (default 0)");
121: function hdisp($id,$html=true)
122: {
123: global $NATS_Help;
124: if (!isset($NATS_Help[strtoupper($id)])) return "";
125: $t=$NATS_Help[strtoupper($id)];
126: $o="";
127: $mode="text";
128: $linktext=false;
129: for ($a=0; $a<strlen($t); $a++)
130: 	{
131: 	$c=$t[$a];
133: 	if ($c=="{") // start of a link
134: 		{
135: 		$mode="link";
136: 		$linktext=false;
137: 		$linkid="";
138: 		$linktxt="";
139: 		}
141: 	else if ( ($mode=="link") && ($c=="|") ) // in a link and move into text mode...
142: 		{
143: 		$linktext=true;
144: 		}
146: 	else if ( ($mode=="link") && ($c=="}") ) // in a link and the end of the link
147: 		{
148: 		if (!$linktext) $linktxt=$linkid;
149: 		if ($html) $o.="<a href=\"help.php?id=".$linkid."\">";
150: 		$o.=$linktxt;
151: 		if ($html) $o.="</a>";
152: 		$mode="text";
153: 		}
155: 	else if ( $mode=="link" ) // in a link
156: 		{
157: 		if ($linktext) $linktxt.=$c;
158: 		else $linkid.=$c;
159: 		}
161: 	else // in text
162: 		$o.=$c;
163: 	}
164: return $o;
165: }
167: function hlink($id,$size=16)
168: {
169: global $NATS_Help;
170: if (isset($NATS_Help[strtoupper($id)]))
171: 	return "<a href=\"javascript:freenats_help('".$id."')\"><img src=\"images/info".$size.".gif\" title=\"".hdisp($id,false)."\" border=0></a>";
173: return "<img src=\"images/info".$size."g.gif\" border=0 title=\"Sorry, no help available. (".$id.")\">";
174: }
176: function ph($id,$size=16)
177: {
178: echo hlink($id,$size);
179: }
180: ?>