ASNMTAP

 view release on metacpan or  search on metacpan

AUTHORS  view on Meta::CPAN



# FEATURE REQUEST - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Yves Van den Hove <yvdhove@users.sourceforge.net>
  * 1727568 Bij wisselen omgeving op dezelfde pagina blijven.
  * 1725445 Groeperen Mails
  * 1768193 PDF issues with Adobe Acrobat 8
  * 1768190 Please filter out the passwords from the HTML dump files for J2EE based Applications
  * 1724056 Timeout for Webtransact
  * 1706596 Collapse error summary


Tom De Clercq <tomsworld@users.sourceforge.net> 
  * 1507255 Detailed Statistics and Report Generation - output


# CONTRIBUTORS  - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

applications/display-test.pl  view on Meta::CPAN

  } elsif ($statusMessage =~ /403 Forbidden Connection/ ) {
    $errorMessage = 'The server understood the request, but is refusing to fulfill it. Access to a resource is not allowed. The most frequent case of this occurs when directory listing access is not allowed';
  } elsif ($statusMessage =~ /404 Page Not Found/ ) {
    $errorMessage = 'The resource request was not found. This is the code returned for missing pages or graphics. Viruses will often attempt to access resources that do not exist, so the error does not necessarily represent a problem';
  } elsif ($statusMessage =~ /405 Method Not Allowed/ ) {
    $errorMessage = 'The access method (GET, POST, HEAD) is not allowed on this resource';
  } elsif ($statusMessage =~ /406 Not Acceptable/ ) {
    $errorMessage = 'None of the acceptable file types (as requested by client) are available for this resource';
  } elsif ($statusMessage =~ /407 Proxy Authentication Required/ ) {
    $errorMessage = 'The client does not have access to this resource, proxy authorization is needed';
  } elsif ($statusMessage =~ /408 Request Timeout/ ) {
    $errorMessage = 'The client did not send a request within the required time period';
  } elsif ($statusMessage =~ /409 Conflict/ ) {
    $errorMessage = 'The request could not be completed due to a conflict with the current state of the resource';
  } elsif ($statusMessage =~ /410 Gone/ ) {
    $errorMessage = 'The requested resource is no longer available at the server and no forwarding address is known. This condition is similar to 404, except that the 410 error condition is expected to be permanent. Any robot seeing this response sho...
  } elsif ($statusMessage =~ /411 Length Required/ ) {
    $errorMessage = 'The request requires the Content-Length HTTP request field to be specified';
  } elsif ($statusMessage =~ /412 Precondition Failed/ ) {
    $errorMessage = 'The precondition given in one or more of the request-header fields evaluated to false when it was tested on the server';
  } elsif ($statusMessage =~ /413 Request Entity Too Large/ ) {

applications/display-test.pl  view on Meta::CPAN

  } elsif ($statusMessage =~ /500 Server Error/ ) {
    $errorMessage = 'The server had some sort of internal error trying to fulfil the request. The client may see a partial page or error message';
  } elsif ($statusMessage =~ /500 SSL read timeout/ ) {
    $errorMessage = 'The server had some sort of internal error trying to fulfil the request. The client may see a partial page or error message';
  } elsif ($statusMessage =~ /501 Not Implemented/ ) {
    $errorMessage = 'Function not implemented in Web server software. The request needs functionality not available on the server';
  } elsif ($statusMessage =~ /502 Bad Gateway/ ) {
    $errorMessage = 'Bad Gateway: a server being used by this Web server has sent an invalid response. The response by an intermediary server was invalid. This may happen if there is a problem with the DNS routing tables';
  } elsif ($statusMessage =~ /503 Service Unavailable/ ) {
    $errorMessage = 'Service temporarily unavailable because of currently/temporary overload or maintenance';
  } elsif ($statusMessage =~ /504 Gateway Timeout/ ) {
    $errorMessage = 'The server did not respond back to the gateway within acceptable time period';
  } elsif ($statusMessage =~ /505 HTTP Version Not Supported/ ) {
    $errorMessage = 'The server does not support the HTTP protocol version that was used in the request message';
  # ***************************************************************************
  # Error codes indicate an error with the ...                                *
  # ***************************************************************************
  } elsif ($statusMessage =~ /Failure of server APACHE bridge/ ) {
    $errorMessage = 'Weblogic Bridge Message: Failure of server APACHE bridge';

    if ($statusMessage =~ /No backend server available for connection/ ) {

applications/display.pl  view on Meta::CPAN

  } elsif ($statusMessage =~ /403 Forbidden Connection/ ) {
    $errorMessage = 'The server understood the request, but is refusing to fulfill it. Access to a resource is not allowed. The most frequent case of this occurs when directory listing access is not allowed';
  } elsif ($statusMessage =~ /404 Page Not Found/ ) {
    $errorMessage = 'The resource request was not found. This is the code returned for missing pages or graphics. Viruses will often attempt to access resources that do not exist, so the error does not necessarily represent a problem';
  } elsif ($statusMessage =~ /405 Method Not Allowed/ ) {
    $errorMessage = 'The access method (GET, POST, HEAD) is not allowed on this resource';
  } elsif ($statusMessage =~ /406 Not Acceptable/ ) {
    $errorMessage = 'None of the acceptable file types (as requested by client) are available for this resource';
  } elsif ($statusMessage =~ /407 Proxy Authentication Required/ ) {
    $errorMessage = 'The client does not have access to this resource, proxy authorization is needed';
  } elsif ($statusMessage =~ /408 Request Timeout/ ) {
    $errorMessage = 'The client did not send a request within the required time period';
  } elsif ($statusMessage =~ /409 Conflict/ ) {
    $errorMessage = 'The request could not be completed due to a conflict with the current state of the resource';
  } elsif ($statusMessage =~ /410 Gone/ ) {
    $errorMessage = 'The requested resource is no longer available at the server and no forwarding address is known. This condition is similar to 404, except that the 410 error condition is expected to be permanent. Any robot seeing this response sho...
  } elsif ($statusMessage =~ /411 Length Required/ ) {
    $errorMessage = 'The request requires the Content-Length HTTP request field to be specified';
  } elsif ($statusMessage =~ /412 Precondition Failed/ ) {
    $errorMessage = 'The precondition given in one or more of the request-header fields evaluated to false when it was tested on the server';
  } elsif ($statusMessage =~ /413 Request Entity Too Large/ ) {

applications/display.pl  view on Meta::CPAN

  } elsif ($statusMessage =~ /500 Server Error/ ) {
    $errorMessage = 'The server had some sort of internal error trying to fulfil the request. The client may see a partial page or error message';
  } elsif ($statusMessage =~ /500 SSL read timeout/ ) {
    $errorMessage = 'The server had some sort of internal error trying to fulfil the request. The client may see a partial page or error message';
  } elsif ($statusMessage =~ /501 Not Implemented/ ) {
    $errorMessage = 'Function not implemented in Web server software. The request needs functionality not available on the server';
  } elsif ($statusMessage =~ /502 Bad Gateway/ ) {
    $errorMessage = 'Bad Gateway: a server being used by this Web server has sent an invalid response. The response by an intermediary server was invalid. This may happen if there is a problem with the DNS routing tables';
  } elsif ($statusMessage =~ /503 Service Unavailable/ ) {
    $errorMessage = 'Service temporarily unavailable because of currently/temporary overload or maintenance';
  } elsif ($statusMessage =~ /504 Gateway Timeout/ ) {
    $errorMessage = 'The server did not respond back to the gateway within acceptable time period';
  } elsif ($statusMessage =~ /505 HTTP Version Not Supported/ ) {
    $errorMessage = 'The server does not support the HTTP protocol version that was used in the request message';
  # ***************************************************************************
  # Error codes indicate an error with the ...                                *
  # ***************************************************************************
  } elsif ($statusMessage =~ /Failure of server APACHE bridge/ ) {
    $errorMessage = 'Weblogic Bridge Message: Failure of server APACHE bridge';

    if ($statusMessage =~ /No backend server available for connection/ ) {

applications/htmlroot/JSFX_Falling.js  view on Meta::CPAN

	this.id = "JSFX_FallingObj_"+JSFX.FallingObj.count++;
	this.sprites = new Array();
	for(i=0 ; i<numSprites; i++)
	{
		this.sprites[i]=new JSFX.FallingSprite(theImage);
	}
	window[this.id]=this;
	this.animate();

	if(stopTime)
		setTimeout("window."+this.id+".stop()", stopTime*1000);

}
JSFX.FallingObj.count = 0;

JSFX.FallingObj.prototype.stop = function()
{
	for(i=0 ; i<this.sprites.length ; i++)
		this.sprites[i].state = "STOPPING";
}

JSFX.FallingObj.prototype.animate = function()
{
	setTimeout("window."+this.id+".animate()", 40);

	for(i=0 ; i<this.sprites.length ; i++)
		this.sprites[i].animate();

}
/*** END Class FallingObj ***/

/*
 * Class Falling extends Object (Static method for creating "Falling" objects
 */

applications/htmlroot/JSFX_Fireworks.js  view on Meta::CPAN

{
	JSFX.FireworkDisplay.Fireworks = new Array();
	JSFX.FireworkDisplay.running = true;

	JSFX.FireworkDisplay.loadImages();

	var i=0;
	for(i=0 ; i<numFireworks; i++)
		JSFX.FireworkDisplay.Fireworks[i]=new JSFX.Firework(i, JSFX.FireworkDisplay.fwImages);

	setTimeout("JSFX.FireworkDisplay.animate()", 30 );
}
JSFX.FireworkDisplay.loadImages = function()
{
	var i;
	JSFX.FireworkDisplay.fwImages = new Array();

	for(i=0 ; i<21 ; i++)
	{
		JSFX.FireworkDisplay.fwImages[i] = new Image();
		JSFX.FireworkDisplay.fwImages[i].src = "/asnmtap/img/fw0/"+i+".gif"
	}
}
JSFX.FireworkDisplay.animate = function()
{
	var i;
	for(i=0 ; i<JSFX.FireworkDisplay.Fireworks.length ; i++)
		JSFX.FireworkDisplay.Fireworks[i].animate();

	setTimeout("JSFX.FireworkDisplay.animate()", 30);
}
/*
 * End Class FireworkDisplay
 */

/*
 * Class Firework extends Layer
 */
JSFX.Firework = function(fwNo, theImages)
{

applications/htmlroot/JSFX_Fireworks2.js  view on Meta::CPAN

{
	JSFX.FireworkDisplay2.Fireworks = new Array();
	JSFX.FireworkDisplay2.running = true;

	JSFX.FireworkDisplay2.loadImages();

	var i=0;
	for(i=0 ; i<numFireworks; i++)
		JSFX.FireworkDisplay2.Fireworks[i]=new JSFX.Firework(i, JSFX.FireworkDisplay2.fwImages);

	setTimeout("JSFX.FireworkDisplay2.animate()", 30 );
}
JSFX.FireworkDisplay2.loadImages = function()
{
	var i;
	JSFX.FireworkDisplay2.fwImages = new Array();

	for(i=0 ; i<21 ; i++)
	{
		JSFX.FireworkDisplay2.fwImages[i] = new Image();
		JSFX.FireworkDisplay2.fwImages[i].src = "/asnmtap/img/fw0/"+i+".gif"
	}
}
JSFX.FireworkDisplay2.animate = function()
{
	var i;
	for(i=0 ; i<JSFX.FireworkDisplay2.Fireworks.length ; i++)
		JSFX.FireworkDisplay2.Fireworks[i].animate();

	setTimeout("JSFX.FireworkDisplay2.animate()", 30);
}
/*
 * End Class FireworkDisplay2
 */

/*
 * Class Firework extends Layer
 */
JSFX.Firework = function(fwNo, theImages)
{

applications/htmlroot/JSFX_Halloween.js  view on Meta::CPAN

} 
/*** END OF CODE FROM JSFX.Browser.js ***/
/*** START OF CODE FROM JSFX.Ghosts.js ***/

JSFX.Halloween = new Object();
JSFX.Halloween.Ghosts = new Array();
JSFX.Halloween.start = function()
{
	if(JSFX.Halloween.theTimer == null)
	{
		JSFX.Halloween.theTimer = setTimeout("JSFX.Halloween.animateAll()", 40);
	}
}
JSFX.Halloween.animateAll = function()
{
	JSFX.Halloween.theTimer = setTimeout("JSFX.Halloween.animateAll()", 40);
	var sp = JSFX.Halloween.Ghosts;
	var i;
	for(i=0 ; i<sp.length ; i++)
	{
		sp[i].animate();
	}

}
JSFX.AddGhost = function(img)
{

applications/htmlroot/JSFX_Layer.js  view on Meta::CPAN

	            return handler(xl, e);
		}
	}
	JSFX.Layer.prototype.removeEventHandler = function(eventName) 
	{
		this.elem[eventName] = null;
	}
}
/*** Event Handling - End ***/
/**************************************************************************/
JSFX.Layer.prototype.setTimeout = function(f, t) 
{
	setTimeout("window."+this.elem.id+"."+f, t);
}

applications/htmlroot/overlib.js  view on Meta::CPAN

	o3_frame = ol_frame;
	
	if(!(over=createDivContainer())) return false;

	parseTokens('o3_', overlib.arguments);
	if (!postParseChecks()) return false;

	if (o3_delay == 0) {
		return runHook("olMain", FREPLACE);
 	} else {
		o3_delayid = setTimeout("runHook('olMain', FREPLACE)", o3_delay);
		return false;
	}
}

// Clears popups if appropriate
function nd(time) {
	if (olLoaded && !isExclusive()) {
		hideDelay(time);  // delay popup close if time specified

		if (o3_removecounter >= 1) { o3_showingsticky = 0 };

applications/htmlroot/overlib.js  view on Meta::CPAN

			} else {
				// No close text
				layerhtml = runHook('ol_content_caption', FALTERNATE, o3_css, o3_text, o3_cap, "");
			}
		}
	}	

	// We want it to stick!
	if (o3_sticky) {
		if (o3_timerid > 0) {
			clearTimeout(o3_timerid);
			o3_timerid = 0;
		}
		o3_showingsticky = 1;
		o3_removecounter = 0;
	}

	// Created a separate routine to generate the popup to make it easier
	// to implement a plugin capability
	if (!runHook("createPopup", FREPLACE, layerhtml)) return false;

applications/htmlroot/overlib.js  view on Meta::CPAN

	if (o3_autostatus > 0) {
		o3_status = o3_text;
		if (o3_autostatus > 1) o3_status = o3_cap;
	}

	// When placing the layer the first time, even stickies may be moved.
	o3_allowmove = 0;

	// Initiate a timer for timeout
	if (o3_timeout > 0) {          
		if (o3_timerid > 0) clearTimeout(o3_timerid);
		o3_timerid = setTimeout("cClick()", o3_timeout);
	}

	// Show layer
	runHook("disp", FREPLACE, o3_status);
	runHook("olMain", FAFTER);

	return (olOp && event && event.type == 'mouseover' && !o3_status) ? '' : (o3_status != '');
}

////////

applications/htmlroot/overlib.js  view on Meta::CPAN

// HANDLING FUNCTIONS
////////
var olShowId=-1;

// Displays the popup
function disp(statustext) {
	runHook("disp", FBEFORE);
	
	if (o3_allowmove == 0) {
		runHook("placeLayer", FREPLACE);
		(olNs6&&olShowId<0) ? olShowId=setTimeout("runHook('showObject', FREPLACE, over)", 1) : runHook("showObject", FREPLACE, over);
		o3_allowmove = (o3_sticky || o3_followmouse==0) ? 0 : 1;
	}
	
	runHook("disp", FAFTER);

	if (statustext != "") self.status = statustext;
}

// Creates the actual popup structure
function createPopup(lyrContent){

applications/htmlroot/overlib.js  view on Meta::CPAN

	theObj.visibility = 'visible';

	runHook("showObject", FAFTER);
}

// Hides an object
function hideObject(obj) {
	runHook("hideObject", FBEFORE);

	var theObj=(olNs4 ? obj : obj.style);
	if (olNs6 && olShowId>0) { clearTimeout(olShowId); olShowId=0; }
	theObj.visibility = 'hidden';
	theObj.top = theObj.left = ((olIe4&&!olOp) ? 0 : -10000) + (!olNs4 ? 'px' : 0);

	if (o3_timerid > 0) clearTimeout(o3_timerid);
	if (o3_delayid > 0) clearTimeout(o3_delayid);

	o3_timerid = 0;
	o3_delayid = 0;
	self.status = "";

	if (obj.onmouseout||obj.onmouseover) {
		if (olNs4) obj.releaseEvents(Event.MOUSEOUT || Event.MOUSEOVER);
		obj.onmouseout = obj.onmouseover = null;
	}

applications/htmlroot/overlib.js  view on Meta::CPAN


	return 0;
}

// Handle hovering
function opt_NOCLOSE(unused) {
	if (!unused) o3_close = "";

	if (olNs4) {
		over.captureEvents(Event.MOUSEOUT || Event.MOUSEOVER);
		over.onmouseover = function () { if (o3_timerid > 0) { clearTimeout(o3_timerid); o3_timerid = 0; } }
		over.onmouseout = function (e) { if (olHideDelay) hideDelay(olHideDelay); else cClick(e); }
	} else {
		over.onmouseover = function () {hoveringSwitch = true; if (o3_timerid > 0) { clearTimeout(o3_timerid); o3_timerid =0; } }
	}

	return 0;
}

// Function to scan command line arguments for multiples
function opt_MULTIPLEARGS(i, args, parameter) {
  var k=i, re, pV, str='';

  for(k=i; k<args.length; k++) {

applications/htmlroot/overlib.js  view on Meta::CPAN

	}

	Str+= ((ary.length==1) ? ary[0] + 'px;' : top + 'px ' + right + 'px ' + bottom + 'px ' + left + 'px;');

	return Str;
}

// function will delay close by time milliseconds
function hideDelay(time) {
	if (time&&!o3_delay) {
		if (o3_timerid > 0) clearTimeout(o3_timerid);

		o3_timerid=setTimeout("cClick()",(o3_timeout=time));
	}
}

// Was originally in the placeLayer() routine; separated out for future ease
function horizontalPlacement(browserWidth, horizontalScrollAmount, widthFix) {
	var placeX, iwidth=browserWidth, winoffset=horizontalScrollAmount;
	var parsedWidth = parseInt(o3_width);

	if (o3_fixx > -1 || o3_relx != null) {
		// Fixed position

applications/htmlroot/overlib_followscroll.js  view on Meta::CPAN

///////
// SUPPORT ROUTINES FOR SCROLL FEATURE
///////

// Scroller constructor
function Scroller(X,Y,refresh) {
	this.canScroll=0;
	this.refresh=refresh;
	this.x=X;
	this.y=Y;
	this.timer=setTimeout("repositionOver()",this.refresh);
}

// Removes the timer to stop replacing the layer.
function cancelScroll() {
	if (!o3_followscroll || typeof over.scroller == 'undefined') return;
	over.scroller.canScroll = 1;
	
	if (over.scroller.timer) {
		clearTimeout(over.scroller.timer);
		over.scroller.timer=null;
	}
}

// Find out how much we've scrolled.
	function getPageScrollY() {
	if (o3_frame.pageYOffset) return o3_frame.pageYOffset;
	if (eval(docRoot)) return eval('o3_frame.' + docRoot + '.scrollTop');
	return -1;
}

applications/htmlroot/overlib_followscroll.js  view on Meta::CPAN


// Repositions the layer if needed
function repositionOver() {
	var X, Y, pgLeft, pgTop;
	pgTop = getPageScrollY();
	pgLeft = getPageScrollX();
	X = getLayerLeft(over)-pgLeft;
	Y = getLayerTop(over)-pgTop;
	
	if (X != over.scroller.x || Y != over.scroller.y) repositionTo(over, pgLeft+over.scroller.x, pgTop+over.scroller.y);
	over.scroller.timer = setTimeout("repositionOver()", over.scroller.refresh);
}

////////
// PLUGIN REGISTRATIONS
////////
registerRunTimeFunction(setScrollVariables);
registerCmdLineFunction(parseScrollExtras);
registerHook("hideObject",cancelScroll,FAFTER);
registerHook("placeLayer",scroll_placeLayer,FREPLACE);
if (olInfo.meets(4.10)) registerNoParameterCommands('followscroll');

applications/htmlroot/snmptraps/include/js/overlib.js  view on Meta::CPAN

	o3_frame = ol_frame;
	
	if(!(over=createDivContainer())) return false;

	parseTokens('o3_', overlib.arguments);
	if (!postParseChecks()) return false;

	if (o3_delay == 0) {
		return runHook("olMain", FREPLACE);
 	} else {
		o3_delayid = setTimeout("runHook('olMain', FREPLACE)", o3_delay);
		return false;
	}
}

// Clears popups if appropriate
function nd(time) {
	if (olLoaded && !isExclusive()) {
		hideDelay(time);  // delay popup close if time specified

		if (o3_removecounter >= 1) { o3_showingsticky = 0 };

applications/htmlroot/snmptraps/include/js/overlib.js  view on Meta::CPAN

			} else {
				// No close text
				layerhtml = runHook('ol_content_caption', FALTERNATE, o3_css, o3_text, o3_cap, "");
			}
		}
	}	

	// We want it to stick!
	if (o3_sticky) {
		if (o3_timerid > 0) {
			clearTimeout(o3_timerid);
			o3_timerid = 0;
		}
		o3_showingsticky = 1;
		o3_removecounter = 0;
	}

	// Created a separate routine to generate the popup to make it easier
	// to implement a plugin capability
	if (!runHook("createPopup", FREPLACE, layerhtml)) return false;

applications/htmlroot/snmptraps/include/js/overlib.js  view on Meta::CPAN

	if (o3_autostatus > 0) {
		o3_status = o3_text;
		if (o3_autostatus > 1) o3_status = o3_cap;
	}

	// When placing the layer the first time, even stickies may be moved.
	o3_allowmove = 0;

	// Initiate a timer for timeout
	if (o3_timeout > 0) {          
		if (o3_timerid > 0) clearTimeout(o3_timerid);
		o3_timerid = setTimeout("cClick()", o3_timeout);
	}

	// Show layer
	runHook("disp", FREPLACE, o3_status);
	runHook("olMain", FAFTER);

	return (olOp && event && event.type == 'mouseover' && !o3_status) ? '' : (o3_status != '');
}

////////

applications/htmlroot/snmptraps/include/js/overlib.js  view on Meta::CPAN

// HANDLING FUNCTIONS
////////
var olShowId=-1;

// Displays the popup
function disp(statustext) {
	runHook("disp", FBEFORE);
	
	if (o3_allowmove == 0) {
		runHook("placeLayer", FREPLACE);
		(olNs6&&olShowId<0) ? olShowId=setTimeout("runHook('showObject', FREPLACE, over)", 1) : runHook("showObject", FREPLACE, over);
		o3_allowmove = (o3_sticky || o3_followmouse==0) ? 0 : 1;
	}
	
	runHook("disp", FAFTER);

	if (statustext != "") self.status = statustext;
}

// Creates the actual popup structure
function createPopup(lyrContent){

applications/htmlroot/snmptraps/include/js/overlib.js  view on Meta::CPAN

	theObj.visibility = 'visible';

	runHook("showObject", FAFTER);
}

// Hides an object
function hideObject(obj) {
	runHook("hideObject", FBEFORE);

	var theObj=(olNs4 ? obj : obj.style);
	if (olNs6 && olShowId>0) { clearTimeout(olShowId); olShowId=0; }
	theObj.visibility = 'hidden';
	theObj.top = theObj.left = ((olIe4&&!olOp) ? 0 : -10000) + (!olNs4 ? 'px' : 0);

	if (o3_timerid > 0) clearTimeout(o3_timerid);
	if (o3_delayid > 0) clearTimeout(o3_delayid);

	o3_timerid = 0;
	o3_delayid = 0;
	self.status = '';

	if (obj.onmouseout || obj.onmouseover) {
		if (olNs4) obj.releaseEvents(Event.MOUSEOUT || Event.MOUSEOVER);
		obj.onmouseout = obj.onmouseover = null;
	}

applications/htmlroot/snmptraps/include/js/overlib.js  view on Meta::CPAN


	return 0;
}

// Handle hovering
function opt_NOCLOSE(unused) {
	if (!unused) o3_close = '';

	if (olNs4) {
		over.captureEvents(Event.MOUSEOUT || Event.MOUSEOVER);
		over.onmouseover = function () { if (o3_timerid > 0) { clearTimeout(o3_timerid); o3_timerid = 0; } }
		over.onmouseout = function (e) { if (olHideDelay) hideDelay(olHideDelay); else cClick(e); }
	} else {
		over.onmouseover = function () {hoveringSwitch = true; if (o3_timerid > 0) { clearTimeout(o3_timerid); o3_timerid =0; } }
	}

	return 0;
}

// Function to scan command line arguments for multiples
function opt_MULTIPLEARGS(i, args, parameter) {
  var k=i, re, pV, str='';

  for(k=i; k<args.length; k++) {

applications/htmlroot/snmptraps/include/js/overlib.js  view on Meta::CPAN

}

// dummy function which will be overridden 
function isExclusive(args) {
	return false;
}

// function will delay close by time milliseconds
function hideDelay(time) {
	if (time&&!o3_delay) {
		if (o3_timerid > 0) clearTimeout(o3_timerid);

		o3_timerid=setTimeout("cClick()",(o3_timeout=time));
	}
}

// Was originally in the placeLayer() routine; separated out for future ease
function horizontalPlacement(browserWidth, horizontalScrollAmount, widthFix) {
	var placeX, iwidth=browserWidth, winoffset=horizontalScrollAmount;
	var parsedWidth = parseInt(o3_width);

	if (o3_fixx > -1 || o3_relx != null) {
		// Fixed position

lib/ASNMTAP/Asnmtap/Applications.pm  view on Meta::CPAN


    print $HTML <<EndOfHtml;
    function startRefresh() {
      var pagedir_id = getPageDirCookie( 'pagedir_id_${pageDir}_${environment}' );

      if (pagedir_id == null || pagedir_id == "" || pagedir_id < 0 || pagedir_id > 2) {
        pagedir_id = 0;
        setPageDirCookie ( 'pagedir_id_${pageDir}_${environment}', '$HTTPSURL/nav/$pagedir', pagedir_id, 365 );
      }

      timerID = setTimeout("location.href='$HTTPSURL/nav/$pagedir/index" + pagedir_prefix[pagedir_id] + ".html'", $startRefresh);
      document.body.style.backgroundImage = 'url($IMAGESURL/startRefresh.gif)';
      document.getElementById('refreshID').innerHTML='<A HREF=\"javascript:stopRefresh();\" title=\"Stop Refresh\" alt=\"Stop Refresh\"><img src=\"$IMAGESURL/stop.gif\" WIDTH=\"32\" HEIGHT=\"27\" BORDER=0><\\/A>'
    }

    function stopRefresh() {
      clearTimeout(timerID);
      document.body.style.backgroundImage = 'url($IMAGESURL/stopRefresh.gif)';
      document.getElementById('refreshID').innerHTML='<A HREF=\"javascript:startRefresh();\" title=\"Start Refresh\" alt=\"Start Refresh\"><img src=\"$IMAGESURL/start.gif\" WIDTH=\"32\" HEIGHT=\"27\" BORDER=0<\\/A>'
    }
EndOfHtml
  }

  print $HTML "  </script>\n";

  if ( $openPngImage eq 'T' ) {
    print $HTML <<EndOfHtml;

lib/ASNMTAP/Asnmtap/Plugins/IO.pm  view on Meta::CPAN


sub scan_socket_info {
  my %defaults = ( asnmtapInherited  => undef,
                   custom            => undef,
                   customArguments   => undef,
                   protocol          => undef,
                   host              => undef,
                   port              => undef,
                   service           => undef,
                   request           => undef,
                   socketTimeout     => undef,
                   timeout           => 10,
                   POP3              => {}
                 );

  my %parms = (%defaults, @_);
  
  my $asnmtapInherited = $parms{asnmtapInherited};
  unless ( defined $asnmtapInherited ) { cluck ( 'ASNMTAP::Asnmtap::Plugins::IO: asnmtapInherited missing' ); exit $ERRORS{UNKNOWN} }

  unless ( defined $parms{protocol} ) {

lib/ASNMTAP/Asnmtap/Plugins/IO.pm  view on Meta::CPAN

      $$asnmtapInherited->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, error => 'Missing attribute mailMessages' }, $TYPE{APPEND} );
      return ( $ERRORS{UNKNOWN} );
    }

    unless ( defined $parms{POP3}{closingSession} ) {
      $$asnmtapInherited->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, error => 'Missing attribute closingSession' }, $TYPE{APPEND} );
      return ( $ERRORS{UNKNOWN} );
    }
  }

  if ( defined $parms{socketTimeout} ) {
    unless ( $parms{socketTimeout} =~ /^([1-9]?(?:\d*))$/ ) {
      $$asnmtapInherited->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, error => 'Wrong value for attribute socketTimeout: '. $parms{socketTimeout} }, $TYPE{APPEND} );
      return ( $ERRORS{UNKNOWN} );
    }
  }

  unless ( $parms{timeout} =~ /^([1-9]?(?:\d*))$/ ) {
    $$asnmtapInherited->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, error => 'Wrong value for attribute timeout: '. $parms{timeout} }, $TYPE{APPEND} );
    return ( $ERRORS{UNKNOWN} );
  }

  my $debug = $$asnmtapInherited->getOptionsValue ( 'debug' ) || 0;

  if ( $debug >= 2 ) {
    print 'ASNMTAP::Asnmtap::Plugins::IO::scan_socket_info::protocol: ', $parms{protocol}, "\n";
    print 'ASNMTAP::Asnmtap::Plugins::IO::scan_socket_info::host: ', $parms{host}, "\n";
    print 'ASNMTAP::Asnmtap::Plugins::IO::scan_socket_info::port: ', $parms{port}, "\n";
    print 'ASNMTAP::Asnmtap::Plugins::IO::scan_socket_info::service: ', $parms{service}, "\n";
    print 'ASNMTAP::Asnmtap::Plugins::IO::scan_socket_info::request: ', $parms{request}, "\n" if ( defined $parms{request} );
    print 'ASNMTAP::Asnmtap::Plugins::IO::scan_socket_info::socketTimeout: ', $parms{socketTimeout}, "\n";
    print 'ASNMTAP::Asnmtap::Plugins::IO::scan_socket_info::timeout: ', $parms{timeout}, "\n";
  }

  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

  my ($exit, $action, $INET);
  $exit   = 0;
  $action = '<NIHIL>';

  $SIG{ALRM} = sub { alarm (0); $exit = 1 };
  alarm ( $parms{timeout} ); $exit = 0;

  use IO::Socket;

  if ( defined $parms{socketTimeout} ) {
    $INET = IO::Socket::INET->new ( Proto => $parms{protocol}, PeerAddr => $parms{host}, PeerPort => $parms{port} );
  } else {
    $INET = IO::Socket::INET->new ( Proto => $parms{protocol}, PeerAddr => $parms{host}, PeerPort => $parms{port}, Timeout => $parms{socketTimeout} );
  }

  if ( $INET ) {
    print "ASNMTAP::Asnmtap::Plugins::IO::scan_socket_info::action::IO::Socket::INET: $INET\n" if ( $debug >= 2 );
  } else {
    print "ASNMTAP::Asnmtap::Plugins::IO::scan_socket_info::action::IO::Socket::INET: Cannot connect to ${parms{host}}:${parms{service}}\n" if ( $debug >= 2 );
    $$asnmtapInherited->pluginValues ( { stateValue => $ERRORS{CRITICAL}, alert => "Cannot connect to ${parms{host}}:${parms{service}}" }, $TYPE{APPEND} );
    return ( $ERRORS{CRITICAL} );
  }

lib/ASNMTAP/Asnmtap/Plugins/IO.pod  view on Meta::CPAN

 use ASNMTAP::Asnmtap::Plugins::IO v3.002.003;
 use ASNMTAP::Asnmtap::Plugins::IO qw(:SOCKET);

 my $returnCode = scan_socket_info (
   asnmtapInherited => \$objectPlugins,
   protocol         => $protocol,
   host             => $host,
   port             => $port,
   service          => $service,
   request          => $request,
   socketTimeout    => 5,
   POP3             => {
     username          => $username, 
     password          => $password, 
     serviceReady      =>  "[XMail [0-9.]+ POP3 Server] service ready",
     passwordRequired  => 'Password required for',
     mailMessages      => "Maildrop has [0-9.]+ messages",
     closingSession    =>  "[XMail [0-9.]+ POP3 Server] closing session"
                       }
 );

lib/ASNMTAP/Asnmtap/Plugins/IO.pod  view on Meta::CPAN

required, scalar, remote port

=item service

required, scalar, remote service

=item request

optional, scalar, default 

=item socketTimeout

timeout	value for various operations

optional, scalar

=item timeout

timeout	value for all operations to die

optional, scalar, default 10

lib/ASNMTAP/Asnmtap/Plugins/Modem.pm  view on Meta::CPAN

                   parity           => 'none',
                   stopbits         => 1,
                   timeout          => 30,
                   phonebook        => undef,
                   username         => undef,
                   password         => undef,
                   defaultGateway   => undef,
                   defaultInterface => undef,
                   defaultDelete    => 1,
                   pppInterface     => 'ppp0',
                   pppTimeout       => 60,
                   pppPath          => '/etc/ppp',
                   logtype          => 'syslog',
                   loglevel         => 'emerg'
                 );

  my %parms = (%defaults, @_);

  my $asnmtapInherited = $parms{asnmtapInherited};
  unless ( defined $asnmtapInherited ) { cluck ( 'ASNMTAP::Asnmtap::Plugins::XML: asnmtapInherited missing' ); exit $ERRORS{UNKNOWN} }

lib/ASNMTAP/Asnmtap/Plugins/Modem.pm  view on Meta::CPAN

  unless ( $parms{defaultDelete} =~ /^(?:[01])$/ ) {
    $$asnmtapInherited->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, error => 'Invalid defaultDelete: '. $parms{defaultDelete} }, $TYPE{APPEND} );
    return ( $ERRORS{UNKNOWN} );
  }

  unless ( $parms{pppInterface} =~ /^(?:ppp[0-3])$/ ) {
    $$asnmtapInherited->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, error => 'Invalid pppInterface: '. $parms{pppInterface} }, $TYPE{APPEND} );
    return ( $ERRORS{UNKNOWN} );
  }

  unless ( $parms{pppTimeout} =~ /^(?:[1-9]\d*)$/ ) {
    $$asnmtapInherited->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, error => 'Invalid pppTimeout: '. $parms{pppTimeout} }, $TYPE{APPEND} );
    return ( $ERRORS{UNKNOWN} );
  }

  unless ( $parms{logtype} =~ /^(?:file|syslog)$/ ) {
    $$asnmtapInherited->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, error => 'Invalid logtype: '. $parms{logtype} }, $TYPE{APPEND} );
    return ( $ERRORS{UNKNOWN} );
  }

  unless ( $parms{loglevel} =~ /^(?:debug|info|notice|warning|err|crit|alert|emerg)$/ ) {
    $$asnmtapInherited->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, error => 'Invalid loglevel: '. $parms{loglevel} }, $TYPE{APPEND} );

lib/ASNMTAP/Asnmtap/Plugins/Modem.pm  view on Meta::CPAN


      my $ATZ= ''; # APE: there are modems that have problems with the command 'ATZ' ! # ' ATZ OK';
      my $command = 'cd '. $parms{pppPath} .'; '. $PPPDCOMMAND .' '. $parms{port} .' '. $parms{baudrate} .' debug user '. $parms{username} .' call '. $parms{phonebook} ." connect \"$CHATCOMMAND -v ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO D...
      print "ASNMTAP::Asnmtap::Plugins::Modem::get_modem_request::pppd: $command\n" if ($debug);

      if ( $$asnmtapInherited->call_system ( "$command" ) ) {
        $$asnmtapInherited->pluginValues ( { alert => "'$command' failed" }, $TYPE{APPEND} );
        $not_connected_guess++;
      } else {
        $SIG{ALRM} = sub { alarm (0); $exit = 1 };
        alarm ( $parms{pppTimeout} ); $exit = 0;

        do {
          my $info; eval { $info = Net::Ifconfig::Wrapper::Ifconfig ('list') };

          if ( defined $info ) {
            $pppStatus = _ppp_interface_info ( $asnmtapInherited, $info, $parms{pppInterface}, $debug );

            if ( $pppStatus eq 'UP' ) {
              $hrasconn = $parms{phonebook};
            } else {

lib/ASNMTAP/Asnmtap/Plugins/Modem.pm  view on Meta::CPAN

        $not_connected_guess++;
      }
    }
  } elsif ( $parms{windows} ) {
    eval {
      no strict 'subs';

      if ( RasHangUp($hrasconn, 3) ) {
        print "ASNMTAP::Asnmtap::Plugins::Modem::get_modem_request::RAS: RAS connection was terminated successfully.\n" if ($debug);
      } elsif ( ! Win32::RASE::GetLastError ) {
        print "ASNMTAP::Asnmtap::Plugins::Modem::get_modem_request::RAS: Timeout. RAS connection is still active.\n" if ($debug);
        $$asnmtapInherited->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, error => 'Timeout. RAS connection is still active.' }, $TYPE{APPEND} );
      } else {
        print "ASNMTAP::Asnmtap::Plugins::Modem::get_modem_request::RAS: ", Win32::RASE::FormatMessage, "\n";
        $$asnmtapInherited->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, error => ' '. Win32::RASE::FormatMessage }, $TYPE{APPEND} );
      }
    }
  } else {
    $$asnmtapInherited->call_system ( $ROUTECOMMAND .' del default' ) if ( $parms{defaultDelete} );
    $$asnmtapInherited->call_system ( $KILLALLCOMMAND .' -HUP pppd' );
    $$asnmtapInherited->call_system ( $ROUTECOMMAND .' add default gw '. $parms{defaultGateway} .' dev '. $parms{defaultInterface} ); # if ( $parms{defaultDelete} );
  }

lib/ASNMTAP/Asnmtap/Plugins/Modem.pod  view on Meta::CPAN

if under Linux or some kind of unix machine it means to delete the default gateway

optional, scalar, default 1

=item pppInterface

the name from the ppp interface

optional, scalar, can be ppp0, ppp1, ppp2 or ppp3, default ppp0

=item pppTimeout

timeout for when it is not possible to setup an ppp connection

optional, scalar, default 60

=item pppPath

path where the ppp config is located

optional, scalar, default /etc/ppp

lib/ASNMTAP/Asnmtap/Plugins/WebTransact.pm  view on Meta::CPAN

use constant Field_Refs	=> {
                             Method	        => { is_ref => FALSE, type => ''      },
                             Url            => { is_ref => FALSE, type => ''      },
                             Qs_var	        => { is_ref => TRUE,  type => 'ARRAY' },
                             Qs_fixed	      => { is_ref => TRUE,  type => 'ARRAY' },
                             Exp            => { is_ref => FALSE, type => 'ARRAY' },
                             Exp_Fault	    => { is_ref => FALSE, type => ''      },
                             Exp_Return     => { is_ref => TRUE,  type => 'HASH'  },
                             Msg            => { is_ref => FALSE, type => ''      },
                             Msg_Fault	    => { is_ref => FALSE, type => ''      },
                             Timeout        => { is_ref => FALSE, type => undef   },
                             Perfdata_Label => { is_ref => FALSE, type => undef   }
                           };

my (%returns, %downloaded, $ua);
keys %downloaded = 128;

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

sub _handleHttpdErrors { print "<hr><h1>ASNMTAP::Asnmtap::Plugins::WebTransact It's not a bug, it's a feature!</h1><p>Error: $_[0]</p><hr>"; }

lib/ASNMTAP/Asnmtap/Plugins/WebTransact.pm  view on Meta::CPAN

  my $returnCode = $parms{fail_if_1} ? $ERRORS{OK} : $ERRORS{CRITICAL};
  my ($response_as_content, $response, $found);

  my $startTime;

  if ( defined $parms{perfdataLabel} and $parms{perfdataLabel} ) {
    ${$self->{asnmtapInherited}}->setEndTime_and_getResponsTime ( ${$self->{asnmtapInherited}}->pluginValue ('endTime') );
    $startTime = ${$self->{asnmtapInherited}}->pluginValue ('endTime');
  }

  my $statusTimeout;

  foreach my $url_r ( @{ $self->{urls} } ) {
    if ( defined $url_r->{Timeout} ) {
      $statusTimeout = 1;
      $ua->timeout ( $url_r->{Timeout} );
      $ua->default_headers->push_header ( 'Keep-Alive' => $url_r->{Timeout} ) if ( $parms{keepAlive} );
    } elsif ( defined $statusTimeout ) {
      $statusTimeout = undef;

      if ( defined $parms{timeout} ) {
        $ua->timeout ( $parms{timeout} );
        $ua->default_headers->push_header ( 'Keep-Alive' => $parms{timeout} ) if ( $parms{keepAlive} );
      } else {
        $ua->timeout ( ${$self->{asnmtapInherited}}->timeout () );
        $ua->default_headers->push_header ( 'Keep-Alive' => ${$self->{asnmtapInherited}}->timeout () ) if ( $parms{keepAlive} );
      }
    }

lib/ASNMTAP/Asnmtap/Plugins/WebTransact.pm  view on Meta::CPAN

          /501 (?:No Server|Not Implemented)/ && do { $errorMessage = "501 Not Implemented"; last; };

          # Bad Gateway: a server being used by this Web server has sent an invalid response.
          # The response by an intermediary server was invalid. This may happen if there is a problem with the DNS routing tables.
          /502 (?:Bad Gateway|Server Overload)/ && do { $knownError = 1; $errorMessage = "502 Bad Gateway"; last; };

          # Service temporarily unavailable because of currently/temporary overload or maintenance.
          /503 (?:Out of Resources|Service Unavailable)/ && do { $knownError = 1; $errorMessage = "503 Service Unavailable"; last; };

          # The server did not respond back to the gateway within acceptable time period
          /504 Gateway Time-?Out/ && do { $knownError = 1; $errorMessage = "504 Gateway Timeout"; last; };

          # The server does not support the HTTP protocol version that was used in the request message.
          /505 HTTP Version [nN]ot supported/ && do { $knownError = 1; $errorMessage = "505 HTTP Version Not Supported"; last; };

          # ***************************************************************************
          # The 400 series of Web error codes indicate an error with your Web browser *
          # ***************************************************************************

          # The request could not be understood by the server due to incorrect syntax.
          /400 Bad Request/ && do { $knownError = 1; $errorMessage = "400 Bad Request"; last; };

lib/ASNMTAP/Asnmtap/Plugins/WebTransact.pm  view on Meta::CPAN

          # The access method (GET, POST, HEAD) is not allowed on this resource
          /405 Method Not Allowed/ && do { $knownError = 1; $errorMessage = "405 Method Not Allowed"; last; };

          # None of the acceptable file types (as requested by client) are available for this resource
          /406 Not Acceptable/ && do { $errorMessage = "406 Not Acceptable"; last; };

          # The client does not have access to this resource, proxy authorization is needed
          /407 Proxy Authentication Required/ && do { $knownError = 1; $errorMessage = "407 Proxy Authentication Required"; last; };

          # The client did not send a request within the required time period
          /408 Request Time(?:[- ])?[oO]ut/ && do { $knownError = 1; $errorMessage = "408 Request Timeout"; last; };

          # The request could not be completed due to a conflict with the current state of the resource.
          /409 Conflict/ && do { $knownError = 1; $errorMessage = "409 Conflict"; last; };

          # The requested resource is no longer available at the server and no forwarding address is known.
          # This condition is similar to 404, except that the 410 error condition is expected to be permanent.
          # Any robot seeing this response should delete the reference from its information store.
          /410 Gone/ && do { $knownError = 1; $errorMessage = "410 Gone"; last; };

          # The request requires the Content-Length HTTP request field to be specified

lib/ASNMTAP/Asnmtap/Plugins/WebTransact.pod  view on Meta::CPAN

 SSLProtocol -all +TLSv1 +SSLv3 

 # Notice: Most problems of broken clients are also related to the HTTP keep-alive facility.
 SetEnvIf User-Agent ".*MSIE.*" \
          nokeepalive ssl-unclean-shutdown \
          downgrade-1.0 force-response-1.0

 # Inter-Process Session Cache:
 # Configure the SSL Session Cache: First the mechanism to use and second the expiring timeout (in seconds).
 SSLSessionCache         dbm:/var/cache/mod_ssl/scache(512000)
 SSLSessionCacheTimeout  300

=back

=back

=back

=back

A new ASNMTAP::Asnmtap::Plugins::WebTransact object must be created with the I<new> method. Once

lib/ASNMTAP/Asnmtap/Plugins/WebTransact.pod  view on Meta::CPAN

 {
   Method         => HEAD|GET|POST,
   Url            => 'http://...',
   Qs_var         => [ cgi_var_name_1 => val_at_run_time, ... ],
   Qs_fixed       => [ cgi_var_name_1 => val_1, ... ],
   Exp            => blah,
   Exp_Fault      => blurb,
   Exp_Return     => { var_label_1 => EXP_VAR_LABEL_1, ... },
   Msg            => 'Status error when not all Exp found',
   Msg_Fault      => 'Status error when Exp_Fault found',
   Timeout        => 30,
   Perfdata_Label => 'Label x'
 }

Qs_fixed and Qs_var are used to generate a query string.

Exp, Exp_Fault and Exp_Return are normal Perl patterns without pattern match delimiters. Most often they are strings.

=over 4

=item Method

lib/ASNMTAP/Asnmtap/Plugins/WebTransact.pod  view on Meta::CPAN

This message is added to the error field when not all Exp found.

Is an scalar (value is a string), ex. 'Status error when not all Exp found'

=item Msg_Fault

This message is added to the error field when Exp_Fault found.

Is an scalar (value is a string), ex. 'Status error when Exp_Fault found'

=item Timeout

This means that for this URL the specified timeout will be used.

Is an scalar (value is a integer greater then 0), ex. 30

=item Perfdata_Label

This means that for this URL there performance data will be created and the name for the label equals the value from Perfdata_Label.

Is an scalar (value is a string), ex. 'Label x'

lib/ASNMTAP/Asnmtap/Plugins/WebTransact.pod  view on Meta::CPAN

  retry the request; return it unless it's a temporary-looking error;
  sleep 3;
  retry the request; return it unless it's a temporary-looking error;
  sleep 15;
  retry the request; return it;

=item I<triesCodes>

Is an string of HTTP codes that merit a retry (like 500 and 408, but unlike 404 or 200), values greater then 200 separated by a ',' or '408,500,502,503,504' (default).

  408 Request Timeout: The client did not send a request within the required time period

  500 Can't connect to ..., Connect failed, Proxy connect failed, Server Error, SSL negotiation failed, SSL read timeout or Internal Server Error: The server had some sort of internal error trying to fulfil the request. The client may see a partial p...

  502 Bad Gateway: Bad Gateway: a server being used by this Web server has sent an invalid response. The response by an intermediary server was invalid. This may happen if there is a problem with the DNS routing tables.

  503 Service Unavailable: Service temporarily unavailable because of currently/temporary overload or maintenance.

  504 Gateway Timeout: The server did not respond back to the gateway within acceptable time period

=item I<openAppend>

Is an scalar, open debugfile as 'Writes, Appends, and Creates' mode when 1, otherwise open debugfile in 'Creates, Writes, and Truncates' mode.

=item I<cookies>

Is an scalar, value is 0 or 1 (default)

=item I<protocol>

lib/ASNMTAP/Asnmtap/Plugins/WebTransact.pod  view on Meta::CPAN


  my $ar = [ { Method         => 'GET',
               Url            => "http://Pericles.IPAustralia.Gov.AU/adds2/ADDS.ADDS_START.intro",
               Qs_var         => [],
               Qs_fixed       => [],
               Exp            => 'Designs Data Searching - Introduction',
               Exp_Fault      => 'We were unable to process your request at this time',
               Exp_Return     => {},
               Msg            => 'Status error when not all Exp found',
               Msg_Fault      => 'Status error when Exp_Fault found',
               Timeout        => 30,
               Perfdata_Label => 'Label x' } ];

  my $objectWebTransact = ASNMTAP::Asnmtap::Plugins::WebTransact->new ( \$objectPlugins, $ar);
  my $returnCode = $objectWebTransact->check ( { tmno => $tmno } );

  foreach ( @{ $objectWebTransact->get_matches() } ) { print $_, "\n"; }

  undef $objectWebTransact;

This example checks if a complete ATMOSS transaction is successfull by getting a sequence

plugins/jUnit/check_jUnit.pl  view on Meta::CPAN


# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# End plugin  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

$objectPlugins->exit (7);

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

sub scan_socket_info_jUnit {
  my ($asnmtapInherited, $protocol, $host, $port, $service, $request, $socketTimeout, $xml, $debug) = @_;

  my ($exit, $result, $action, $socketProtocol);
  $exit   = 0;
  $action = '<NIHIL>';

  print "\nscan_socket_info : <$protocol><$host><$port><$service><$request>\n$xml\n\n" if ($debug >= 2);

  if ($protocol eq 'tcp' || $protocol eq 'udp') { $socketProtocol = $protocol; } else { $socketProtocol = 'tcp'; }

  $SIG{ALRM} = sub { alarm (0); $exit = 1 };
  alarm ( 10 ); $exit = 0;

  use IO::Socket;

  if (defined $socketTimeout) {
    $result = new IO::Socket::INET ('Proto' => $socketProtocol, 'PeerAddr' => $host, 'PeerPort' => $port, 'Timeout' => $socketTimeout);
  } else {
    $result = new IO::Socket::INET ('Proto' => $socketProtocol, 'PeerAddr' => $host, 'PeerPort' => $port);
  }

  if ($result) {
    print "IO::Socket::INET : $result\n" if ($debug >= 2);
  } else {
    print "IO::Socket::INET : <NIHIL>\n" if ($debug >= 2);
    $$asnmtapInherited->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, alert => "Cannot connect to $host:$port" }, $TYPE{APPEND} );
    return ( $ERRORS{UNKNOWN} );

plugins/nagios/templates/check_template-ftp.pl  view on Meta::CPAN


my $timeout = $objectNagios->timeout ();

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Start plugin  - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

my $returnValue = 1;

use Net::FTP;
my $ftp = Net::FTP->new(Host => $host, Timeout => $timeout, Debug => $debug) or $returnValue = errorTrapFTP ("Cannot connect to $host", "$@", $debug);
$ftp->login($username, $password) or $returnValue = errorTrapFTP ('Cannot login', $ftp->message, $debug) if ($returnValue);

if ( $returnValue ) {
  print "You are logged on\n" if ($debug);

  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # Start plugin  - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

  # $ftp->cwd ("/test") or $returnValue = errorTrapFTP ("Cannot change to directory", $ftp->message, $debug ) if ($returnValue);

plugins/templates/check_template-IO.pl  view on Meta::CPAN

# Start plugin  - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

my $returnCode = scan_socket_info (
  asnmtapInherited => \$objectPlugins,
  protocol         => $protocol,
  host             => $host,
  port             => $port,
  service          => $service,
  request          => $request,
  socketTimeout    => 5,
  POP3             => {
    username          => $username, 
    password          => $password, 
    serviceReady      =>  "[XMail [0-9.]+ POP3 Server] service ready",
    passwordRequired  => 'Password required for',
    mailMessages      => "Maildrop has [0-9.]+ messages",
    closingSession    =>  "[XMail [0-9.]+ POP3 Server] closing session"
                      }
);

t/Asnmtap/Plugins/IO.t  view on Meta::CPAN

  $errorStatus = ($returnCode == 3 && $objectPlugins->pluginValue ('error') =~ /\QMissing attribute username\E/);
  ok ( $errorStatus, 'ASNMTAP::Asnmtap::Plugins::IO::scan_socket_info::username: Missing attribute username' );

  $returnCode = scan_socket_info (
    asnmtapInherited => \$objectPlugins,
    protocol         => 'tcp',
    host             => 'smtp.citap.com',
    port             => 110,
    service          => 'pop3',
    POP3             => { username => 'username' },
    socketTimeout    => 'timeout'
  );

  $errorStatus = ($returnCode == 3 && $objectPlugins->pluginValue ('error') =~ /\QMissing attribute password\E/);
  ok ( $errorStatus, 'ASNMTAP::Asnmtap::Plugins::IO::scan_socket_info::password: Missing attribute password' );

  $returnCode = scan_socket_info (
    asnmtapInherited => \$objectPlugins,
    protocol         => 'tcp',
    host             => 'smtp.citap.com',
    port             => 110,
    service          => 'pop3',
    POP3             => { username => 'username', password => 'password' },
    socketTimeout    => 'timeout'
  );

  $errorStatus = ($returnCode == 3 && $objectPlugins->pluginValue ('error') =~ /\QMissing attribute serviceReady\E/);
  ok ( $errorStatus, 'ASNMTAP::Asnmtap::Plugins::IO::scan_socket_info::serviceReady: Missing attribute serviceReady' );

  $returnCode = scan_socket_info (
    asnmtapInherited => \$objectPlugins,
    protocol         => 'tcp',
    host             => 'smtp.citap.com',
    port             => 110,
    service          => 'pop3',
    POP3             => { username => 'username', password => 'password', serviceReady => 'serviceReady' },
    socketTimeout    => 'timeout'
  );

  $errorStatus = ($returnCode == 3 && $objectPlugins->pluginValue ('error') =~ /\QMissing attribute passwordRequired\E/);
  ok ( $errorStatus, 'ASNMTAP::Asnmtap::Plugins::IO::scan_socket_info::passwordRequired: Missing attribute passwordRequired' );

  $returnCode = scan_socket_info (
    asnmtapInherited => \$objectPlugins,
    protocol         => 'tcp',
    host             => 'smtp.citap.com',
    port             => 110,
    service          => 'pop3',
    POP3             => { username => 'username', password => 'password', serviceReady => 'serviceReady', passwordRequired => 'passwordRequired' },
    socketTimeout    => 'timeout'
  );

  $errorStatus = ($returnCode == 3 && $objectPlugins->pluginValue ('error') =~ /\QMissing attribute mailMessages\E/);
  ok ( $errorStatus, 'ASNMTAP::Asnmtap::Plugins::IO::scan_socket_info::mailMessages: Missing attribute mailMessages' );

  $returnCode = scan_socket_info (
    asnmtapInherited => \$objectPlugins,
    protocol         => 'tcp',
    host             => 'smtp.citap.com',
    port             => 110,
    service          => 'pop3',
    POP3             => { username => 'username', password => 'password', serviceReady => 'serviceReady', passwordRequired => 'passwordRequired', mailMessages => 'mailMessages' },
    socketTimeout    => 'timeout'
  );

  $errorStatus = ($returnCode == 3 && $objectPlugins->pluginValue ('error') =~ /\QMissing attribute closingSession\E/);
  ok ( $errorStatus, 'ASNMTAP::Asnmtap::Plugins::IO::scan_socket_info::closingSession: Missing attribute closingSession' );

  $returnCode = scan_socket_info (
    asnmtapInherited => \$objectPlugins,
    protocol         => 'tcp',
    host             => 'smtp.citap.com',
    port             => 110,
    service          => 'pop3',
    POP3             => { username => 'username', password => 'password', serviceReady => 'serviceReady', passwordRequired => 'passwordRequired', mailMessages => 'mailMessages', closingSession => 'closingSession' },
    socketTimeout    => 'timeout'
  );
  
  $errorStatus = ($returnCode == 3 && $objectPlugins->pluginValue ('error') =~ /\QWrong value for attribute socketTimeout: timeout\E/);
  ok ( $errorStatus, 'ASNMTAP::Asnmtap::Plugins::IO::scan_socket_info::socketTimeout: Wrong value for attribute socketTimeout: timeout' );

  no warnings 'deprecated';
  $objectPlugins->{_pluginValues}->{stateValue} = $ERRORS{OK};
  $objectPlugins->{_pluginValues}->{stateError} = $STATE{$ERRORS{OK}};
  $objectPlugins->exit (0);
}



( run in 0.413 second using v1.01-cache-2.11-cpan-a5abf4f5562 )