Maximum Output Software Forum Index Maximum Output Software
High Quality Software for Microsoft Windows
 
 Watched TopicsWatched Topics   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister  RSS 2.0 News Feed
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  MSN Alerts

Customizing the web server pages

 
Post new topic   Reply to topic   printer-friendly view    Maximum Output Software Forum Index -> EZP: Customized Web Interface
 View previous topic :: View next topic  
Author Message
maxoutput_djohnson
Site Admin


Joined: 22 Oct 2002
Posts: 1563
Location: Orem, UT, USA

PostPosted: Fri Jul 07, 2006 10:17 pm    Post subject: Customizing the web server pages Reply with quote

The web server implementation in EZ Pinger makes it very easy to design your own pages for delivery.

File Types

The web server within EZ Pinger only allows a few file types to be served. These are: HTML (.html, .htm), Text (.txt), JPEG (.jpg, .jpeg), GIF (.gif), and PNG (.png). A request for any other file type will return a 404 (page not found) error. All pages delivered by EZ Pinger must reside within the WebServer folder. When delivering pages EZ Pinger ignores the folder path portion of the URL.

Serving Pages

When EZ Pinger loads an HTML or Text file it parses through and replaces text inside the file based on the tags within the file. To make it easier to deal with the tags, every tag used by EZ Pinger occurs in <tag> and </tag> pairs, meaning that most web page design programs can handle and/or ignore the EZ Pinger tags. If a closing tag is missing EZ Pinger completely ignores the opening tag and does not process its contents.

<ie> - anything between the <ie> and </ie> tags is delivered to Internet Explorer clients only. If another browser is used anything between the tags is removed.
<notie> - served to any browser besides Internet Explorer
<mobile> - served to mobile clients, such as Pocket PC devices
<notmobile> - served to non-mobile (desktop) clients
<sound> - served if sound alerts are currently enabled for a given page. Be sure to include %sound% variable, which is replaced with the html to actually play the sound (specify nosound=1 as a parameter to the page to turn sounds off)
<nosound> - served if sounds are turned off
<manageauth> - served to anyone logged on with management privileges
<nomanageauth> - served to anyone logged in with view privileges only
<vars> - specifies a section of the page where parameter values can be set; separate multiple parameters with semicolons (<vars>nosound=1;hoststatus=0</vars>)
<defaults> - same as <vars>, except variables set do not override parametes passed into a page
<back> - served if the noback parameter is not set
<noback> - served if the noback parameter is set
<starthost> - anything in between starthost tags is repeated for each host being monitored by EZ Pinger. The same variables used when sending email are also available here. Of particular note is the %id% variable, which represents a unique host identifier, needed by web-based commands (see below).

Tip: In cases where the page content itself is not being manipulated (<vars> and <defaults> for example) it may be useful to enclose tags within HTML comments (<!-- to -->).

Tags only available within <starthost> tags:
<startgroup> - anything in these tags is inserted into the host list when a new group is encountered. the %displayname% variable is available to represent the group name
<error> - anything in the error tags is served only when a host is set to offline status
<cmd0> through <cmd9> - served only if a particular web-based command is available for a given host. See the command list below
<nocmd0> through <nocmd9> - served only if a particlar web-based command is not available for a given host

Variables

Variables are enclosed within percent markings (%variable%) and are the same as the ones available when sending email from within the EZ Pinger program. There are several other variables not listed there that may be of particular interest from the web interface:

%id% - Unique ID number of a host
%group% - ID number representing the group membership of a host
%hoststatus% - Text description of the status of a host

There are some other variables that are predefined that are available anywhere inside of a served page. The predefined variables currently are:

%computer% - name of computer running EZ Pinger
%user% - user logged into the web interface
%peer% - IP address of client
%server% - Host string as provided by the browser
%url% - URL of current page
%page% - URL with parameters removed
%date% - current server date and time

EZ Pinger also makes available any parameters passed into the page available in variable format as well (hostname.com/hosts.html?nosound=1 would make %nosound% variable available, with any reference being replaced by 1).

The following variables are only available when used within the <starthost> tag:

%icon% - replaced with HTML code to deliver a standard size status icon
%largeicon% - replaced with HTML code to deliver a large status icon
%smallicon% - replaced with HTML code to deliver a small icon
%sound% - replaced with HTML code to play host offline sound when applicable

Web-based commands

All commands must be directed to the "/command" page of the web site (hostname.com/command), and has to include at least two pieces of information: the host ID to process, and the command to execute. An example URL might look like:

hostname.com/command?hostid=00A1B2C3&command=3

The various commands are:
0 - Test host
1 - Basic host status reset
2 - Standard host status reset
3 - Full host status reset
4 - Disable host
5 - Enable host
6 - Simulate host failure
7 - Generate & deliver Remote Desktop (.rdp) file
8 - Redirect to web site (hosts set to HTTP test only)
9 - Send magic wakeup packet
R - Restart the host
S - Shutdown the host

Commands can be issued in several different formats:

hostname.com/command?hostid=(id)&command=(cmd)
hostname.com/command?(hostid)=ON&(hostid)=ON&command=(cmd)
hostname.com/command?(hostid)=(cmd)

The first four of these commands (0-3) are also available for all hosts. Specify 00000000 for the host ID to process these commands for all hosts.

When processing a web command, EZ Pinger will deliver a page confirming the requested actions (for commands 0-6 and 9) or redirect to the appropriate file (7) or web site (8). For the status page, the message.html file is delivered, filling in the %title% and %message% page variables with information about the requested actions. By default this page issues a History.Back command to the browser after ten seconds, but this can be disabled by also providing the noback=1 parameter to the /command page.

Controlling which hosts are included on a page

By default all hosts are included in delivery of any page featuring the <starthost> tag. This can be controlled by specifing one or more parameters to a page providing host information:

hoststatus - deliver information about hosts with a particular status: 0=Okay, 1=Warning, 2=Error, -1=Unknown
hostid - deliver information about only a single host
groupid - deliver information about hosts in a group

These parameters can be tacked onto the end of any page request URL:

hostname.com/hosts.html?hoststatus=2&groupid=1
hostname.com/hosts.html?groupid=1
hostname.com/hostinfo.html?hostid=001A2B3C

Login

If a password has been configured to access the EZ Pinger web server it will not deliver any pages until a client has successfully logged in. If a user logs in with view privileges only and attempts to process a command they will be asked for a username and password to process the command. To force a login prompt, direct the client to the /managelogin page, which will request a management password and if login is successful will return the user to the previous page.

Browser-related issues

The standard pages provided with EZ Pinger will work with or without JavaScript enabled, but offer a great deal more functionality when JavaScript is turned on.

Internet Explorer: All features of the EZ Pinger web interface work with Internet Explorer without any difficulty.

Firefox: Pages are not automatically refreshed after a 'back' or 'forward' operation so host information may appear out of date after processing a command or attempting a management login. (This is done despite the instruction by EZ Pinger to reload the page each time it is displayed). Support for playing sounds requires Quicktime to be installed, and will thus prompt the user to install or configure Quicktime if it has not already been done so. (This is being done by Firefox and EZ Pinger has no control over it.)

Mobile: Mobile browsers tend to not be as fully featured as their PC counterparts. The default pages used by EZ Pinger for mobile clients take as best advantage of mobile browsers as they can, but not all clients have been tested. The mobile versions of the EZ Pinger pages should be kept simple due to browser capability restrictions and the low bandwidth of mobile connections.

Wrap-up
If you decide to create or customize your own pages I recommend looking at the sample pages provided. Feel free to copy the HTML and code within the pages. If you create a notably unique or useful page, please upload it to the forums to share with others.
_________________
Doug Johnson, Software Author
Maximum Output Software
info@maxoutput.com
Back to top
View user's profile Send private message [ Hidden ] Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    Maximum Output Software Forum Index -> EZP: Customized Web Interface All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2002 phpBB Group