ASNMTAP

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

applications/htmlroot/JSFX_Falling.js
applications/htmlroot/JSFX_Fireworks.js
applications/htmlroot/JSFX_Fireworks2.js
applications/htmlroot/JSFX_Halloween.js
applications/htmlroot/JSFX_Layer.js
applications/htmlroot/md5.js
applications/htmlroot/overlib.js
applications/htmlroot/overlib_anchor.js
applications/htmlroot/overlib_centerpopup.js
applications/htmlroot/overlib_crossframe.js
applications/htmlroot/overlib_cssstyle.js
applications/htmlroot/overlib_debug.js
applications/htmlroot/overlib_exclusive.js
applications/htmlroot/overlib_followscroll.js
applications/htmlroot/overlib_hideform.js
applications/htmlroot/overlib_setonoff.js
applications/htmlroot/overlib_shadow.js
applications/htmlroot/PopupWindow.js
applications/htmlroot/TimeParserValidator.js

applications/htmlroot/cgi-bin/comments.pl

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


      if ( $currPriorityGroup ne @$arrayFullCondensedView[1] ) {
        $currPriorityGroup = @$arrayFullCondensedView[1];
        my (undef, undef, $priorityGroup) = split( /-/, $currPriorityGroup );
        print HTMLMCV '<TR><TD class="GroupHeader" COLSPAN=', $colspanDisplayTime, '>', 'Priority: '. $priorityGroup, '</TD></TR>', "\n";
      }

      print HTMLMCV @$arrayFullCondensedView[4];
    }

    print HTMLMCV '<tr style="{height: 4;}"><TD></TD></TR>', "\n";
 	  delete @multiarrayMinimalCondensedView[0..@multiarrayMinimalCondensedView];
  }

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

  printStatusHeader('', $configNumber, $emptyFullView, $emptyCondencedView, $emptyMinimalCondencedView, $playSoundStatus);

  printStatusFooter('', $emptyFullView, $emptyCondencedView, $emptyMinimalCondencedView, $playSoundStatus);

  printHtmlFooter('');

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

      if ($rvOpen) {
        print PNG <<EOM;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
  <title>$APPLICATION @ $BUSINESS</title>
  <META HTTP-EQUIV="Expires" CONTENT="Wed, 10 Dec 2003 00:00:01 GMT">
  <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
  <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
  <META HTTP-EQUIV="Refresh" CONTENT="60">
  <link rel="stylesheet" type="text/css" href="$HTTPSURL/asnmtap.css">
</HEAD>
<BODY>
EOM

        print PNG '<IMG SRC="', $RESULTSURL, '/', $resultsdir, '/', $command, '-', $catalogID_uniqueKey, '-sql.png"></BODY></HTML>', "\n";
        close(PNG);
      } else {
        print "Cannot create $htmlFilename!\n";
      }
    }

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

	  $emptyFullView = ( scalar ( @multiarrayFullCondensedView ) ? 0 : 1 );

      unless ( $emptyFullView ) {
        print HTML '<TR><TD class="GroupHeader" COLSPAN=', $colspanDisplayTime, '>', encode_html_entities('T', $title), '</TD></TR>', "\n";

        foreach my $arrayFullCondensedView ( @multiarrayFullCondensedView ) {
          print HTML @$arrayFullCondensedView[4];
        }
      }

      print HTML '<tr style="{height: 4;}"><TD></TD></TR>', "\n", if $showFooter;
    }

    if ($groupCondensedView) {
	  $emptyCondencedView = ( scalar ( @multiarrayFullCondensedView ) ? 0 : 1 );

      unless ( $emptyCondencedView ) {
        @multiarrayFullCondensedView = ( sort { $a->[2] <=> $b->[2] } @multiarrayFullCondensedView );
        @multiarrayFullCondensedView = ( sort { $b->[0] <=> $a->[0] } @multiarrayFullCondensedView );
        @multiarrayFullCondensedView = ( sort { $a->[3] <=> $b->[3] } @multiarrayFullCondensedView );
        @multiarrayFullCondensedView = ( sort { $a->[1] <=> $b->[1] } @multiarrayFullCondensedView );

        print HTMLCV '<TR><TD class="GroupHeader" COLSPAN=', $colspanDisplayTime, '>', encode_html_entities('T', $title), '</TD></TR>', "\n";

        foreach my $arrayFullCondensedView ( @multiarrayFullCondensedView ) {
          print HTMLCV @$arrayFullCondensedView[4] if ( @$arrayFullCondensedView[5] );
        }
      }

      print HTMLCV '<tr style="{height: 4;}"><TD></TD></TR>', "\n", if $showFooter;
    }
  }
}

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

sub printItemStatus {
  my ($interval, $number, $status, $endTime, $acked, $timeslot, $activationTimeslot, $suspentionTimeslot, $instability, $persistent, $downtime, $suspentionTimeslotPersistentTrue, $suspentionTimeslotPersistentFalse, $catalogID_uniqueKey, $catalogID, $...

  my $statusIcon = ($acked and ($activationTimeslot - $step < $timeslot) and ($suspentionTimeslot > $timeslot)) ? ( $instability ? $ICONSUNSTABLE {$status} : $ICONSACK {$status} ) : $ICONS{$status};

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

}

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

sub printItemFooter {
  my ($catalogID_uniqueKey, $catalogID, $uniqueKey, $title, $status, $timeslot, $statusIcon, $insertInMCV, $inIMW, $itemFullCondensedView, $printCondensedView, $arrayStatusMessage, $catalogID_uKey_timeperiodID) = @_;

  $itemFullCondensedView .= "</TR>\n";

  if (@$arrayStatusMessage) {
    $itemFullCondensedView .= '<TR style="{height: 0;}"><TD COLSPAN="'. $colspanDisplayTime .'"><DIV id="'.$catalogID_uniqueKey.'" style="display:none"><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=2>'. "\n";
    foreach my $arrayStatusMessage ( @$arrayStatusMessage ) { $itemFullCondensedView .= printStatusMessage ( $arrayStatusMessage ); }
    $itemFullCondensedView .= "</TABLE></DIV></TD></TR>\n";
  }

  $groupFullView += 1;

  $groupCondensedView += $printCondensedView;

  my $groep = ( $title =~ /^\[(\d+)\]/ ? $1 : 0);
  push ( @multiarrayFullCondensedView, [ $ERRORS{"$status"}, $groep, $timeslot, $statusIcon, $itemFullCondensedView, $printCondensedView ] );

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


sub printStatusFooter {
  my ($title, $emptyFullView, $emptyCondencedView, $emptyMinimalCondencedView, $playSoundStatus) = @_;

  print HTML   '</TABLE>', "\n";

  print HTML <<EOH;
<script language="JavaScript" type="text/javascript">
  function toggleDiv (div_id){
    if (document.getElementById(div_id)) {
      if (document.getElementById(div_id).style.display == 'none') {
        document.getElementById(div_id).style.display = 'block';
      } else {
        document.getElementById(div_id).style.display = 'none';
      }
    }
  }
</script>
EOH

  if ($playSoundStatus) {
    print HTML <<EOH;
<script language="JavaScript" type="text/javascript">
  var soundState = getSoundCookie( 'soundState' );

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

  }

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

  print HTMLCV '</TABLE>', "\n";

  print HTMLCV <<EOH;
<script language="JavaScript" type="text/javascript">
  function toggleDiv (div_id){
    if (document.getElementById(div_id)) {
      if (document.getElementById(div_id).style.display == 'none') {
        document.getElementById(div_id).style.display = 'block';
      } else {
        document.getElementById(div_id).style.display = 'none';
      }
    }
  }
</script>
EOH

  if ($playSoundStatus) {
    print HTMLCV <<EOH;
<script language="JavaScript" type="text/javascript">
  var soundState = getSoundCookie( 'soundState' );

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

  }

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

  print HTMLMCV '</TABLE>', "\n";

  print HTMLMCV <<EOH;
<script language="JavaScript" type="text/javascript">
  function toggleDiv (div_id){
    if (document.getElementById(div_id)) {
      if (document.getElementById(div_id).style.display == 'none') {
        document.getElementById(div_id).style.display = 'block';
      } else {
        document.getElementById(div_id).style.display = 'none';
      }
    }
  }
</script>
EOH

  if ($playSoundStatus) {
    print HTMLMCV <<EOH;
<script language="JavaScript" type="text/javascript">
  var soundState = getSoundCookie( 'soundState' );

applications/display.pl  view on Meta::CPAN


      if ( $currPriorityGroup ne @$arrayFullCondensedView[1] ) {
        $currPriorityGroup = @$arrayFullCondensedView[1];
        my (undef, undef, $priorityGroup) = split( /-/, $currPriorityGroup );
        print HTMLMCV '<TR><TD class="GroupHeader" COLSPAN=', $colspanDisplayTime, '>', 'Priority: '. $priorityGroup, '</TD></TR>', "\n";
      }

      print HTMLMCV @$arrayFullCondensedView[4];
    }

    print HTMLMCV '<tr style="{height: 4;}"><TD></TD></TR>', "\n";
 	  delete @multiarrayMinimalCondensedView[0..@multiarrayMinimalCondensedView];
  }

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

  printStatusHeader('', $configNumber, $emptyFullView, $emptyCondencedView, $emptyMinimalCondencedView, $playSoundStatus);

  printStatusFooter('', $emptyFullView, $emptyCondencedView, $emptyMinimalCondencedView, $playSoundStatus);

  printHtmlFooter('');

applications/display.pl  view on Meta::CPAN

      if ($rvOpen) {
        print PNG <<EOM;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
  <title>$APPLICATION @ $BUSINESS</title>
  <META HTTP-EQUIV="Expires" CONTENT="Wed, 10 Dec 2003 00:00:01 GMT">
  <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
  <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
  <META HTTP-EQUIV="Refresh" CONTENT="60">
  <link rel="stylesheet" type="text/css" href="$HTTPSURL/asnmtap.css">
</HEAD>
<BODY>
EOM

        print PNG '<IMG SRC="', $RESULTSURL, '/', $resultsdir, '/', $command, '-', $catalogID_uniqueKey, '-sql.png"></BODY></HTML>', "\n";
        close(PNG);
      } else {
        print "Cannot create $htmlFilename!\n";
      }
    }

applications/display.pl  view on Meta::CPAN

	  $emptyFullView = ( scalar ( @multiarrayFullCondensedView ) ? 0 : 1 );

      unless ( $emptyFullView ) {
        print HTML '<TR><TD class="GroupHeader" COLSPAN=', $colspanDisplayTime, '>', encode_html_entities('T', $title), '</TD></TR>', "\n";

        foreach my $arrayFullCondensedView ( @multiarrayFullCondensedView ) {
          print HTML @$arrayFullCondensedView[4];
        }
      }

      print HTML '<tr style="{height: 4;}"><TD></TD></TR>', "\n", if $showFooter;
    }

    if ($groupCondensedView) {
	  $emptyCondencedView = ( scalar ( @multiarrayFullCondensedView ) ? 0 : 1 );

      unless ( $emptyCondencedView ) {
        @multiarrayFullCondensedView = ( sort { $a->[2] <=> $b->[2] } @multiarrayFullCondensedView );
        @multiarrayFullCondensedView = ( sort { $b->[0] <=> $a->[0] } @multiarrayFullCondensedView );
        @multiarrayFullCondensedView = ( sort { $a->[3] <=> $b->[3] } @multiarrayFullCondensedView );
        @multiarrayFullCondensedView = ( sort { $a->[1] <=> $b->[1] } @multiarrayFullCondensedView );

        print HTMLCV '<TR><TD class="GroupHeader" COLSPAN=', $colspanDisplayTime, '>', encode_html_entities('T', $title), '</TD></TR>', "\n";

        foreach my $arrayFullCondensedView ( @multiarrayFullCondensedView ) {
          print HTMLCV @$arrayFullCondensedView[4] if ( @$arrayFullCondensedView[5] );
        }
      }

      print HTMLCV '<tr style="{height: 4;}"><TD></TD></TR>', "\n", if $showFooter;
    }
  }
}

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

sub printItemStatus {
  my ($interval, $number, $status, $endTime, $acked, $timeslot, $activationTimeslot, $suspentionTimeslot, $instability, $persistent, $downtime, $suspentionTimeslotPersistentTrue, $suspentionTimeslotPersistentFalse, $catalogID_uniqueKey, $catalogID, $...

  my $statusIcon = ($acked and ($activationTimeslot - $step < $timeslot) and ($suspentionTimeslot > $timeslot)) ? ( $instability ? $ICONSUNSTABLE {$status} : $ICONSACK {$status} ) : $ICONS{$status};

applications/display.pl  view on Meta::CPAN

}

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

sub printItemFooter {
  my ($catalogID_uniqueKey, $catalogID, $uniqueKey, $title, $status, $timeslot, $statusIcon, $insertInMCV, $inIMW, $itemFullCondensedView, $printCondensedView, $arrayStatusMessage, $catalogID_uKey_timeperiodID) = @_;

  $itemFullCondensedView .= "</TR>\n";

  if (@$arrayStatusMessage) {
    $itemFullCondensedView .= '<TR style="{height: 0;}"><TD COLSPAN="'. $colspanDisplayTime .'"><DIV id="'.$catalogID_uniqueKey.'" style="display:none"><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=2>'. "\n";
    foreach my $arrayStatusMessage ( @$arrayStatusMessage ) { $itemFullCondensedView .= printStatusMessage ( $arrayStatusMessage ); }
    $itemFullCondensedView .= "</TABLE></DIV></TD></TR>\n";
  }

  $groupFullView += 1;

  $groupCondensedView += $printCondensedView;

  my $groep = ( $title =~ /^\[(\d+)\]/ ? $1 : 0);
  push ( @multiarrayFullCondensedView, [ $ERRORS{"$status"}, $groep, $timeslot, $statusIcon, $itemFullCondensedView, $printCondensedView ] );

applications/display.pl  view on Meta::CPAN


sub printStatusFooter {
  my ($title, $emptyFullView, $emptyCondencedView, $emptyMinimalCondencedView, $playSoundStatus) = @_;

  print HTML   '</TABLE>', "\n";

  print HTML <<EOH;
<script language="JavaScript" type="text/javascript">
  function toggleDiv (div_id){
    if (document.getElementById(div_id)) {
      if (document.getElementById(div_id).style.display == 'none') {
        document.getElementById(div_id).style.display = 'block';
      } else {
        document.getElementById(div_id).style.display = 'none';
      }
    }
  }
</script>
EOH

  if ($playSoundStatus) {
    print HTML <<EOH;
<script language="JavaScript" type="text/javascript">
  var soundState = getSoundCookie( 'soundState' );

applications/display.pl  view on Meta::CPAN

  }

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

  print HTMLCV '</TABLE>', "\n";

  print HTMLCV <<EOH;
<script language="JavaScript" type="text/javascript">
  function toggleDiv (div_id){
    if (document.getElementById(div_id)) {
      if (document.getElementById(div_id).style.display == 'none') {
        document.getElementById(div_id).style.display = 'block';
      } else {
        document.getElementById(div_id).style.display = 'none';
      }
    }
  }
</script>
EOH

  if ($playSoundStatus) {
    print HTMLCV <<EOH;
<script language="JavaScript" type="text/javascript">
  var soundState = getSoundCookie( 'soundState' );

applications/display.pl  view on Meta::CPAN

  }

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

  print HTMLMCV '</TABLE>', "\n";

  print HTMLMCV <<EOH;
<script language="JavaScript" type="text/javascript">
  function toggleDiv (div_id){
    if (document.getElementById(div_id)) {
      if (document.getElementById(div_id).style.display == 'none') {
        document.getElementById(div_id).style.display = 'block';
      } else {
        document.getElementById(div_id).style.display = 'none';
      }
    }
  }
</script>
EOH

  if ($playSoundStatus) {
    print HTMLMCV <<EOH;
<script language="JavaScript" type="text/javascript">
  var soundState = getSoundCookie( 'soundState' );

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

	if (document.getElementById)
	{
		var xName="xLayer" + JSFX.layerNo++;
		var txt = ""
			+ "position:absolute;"
			+ "visibility:hidden";

		var newRange = document.createRange();

		elem = document.createElement("DIV");
		elem.setAttribute("style",txt);
		elem.setAttribute("id", xName);

		document.body.appendChild(elem);

		newRange.setStartBefore(elem);
		strFrag = newRange.createContextualFragment(htmlStr);	
		elem.appendChild(strFrag);
	}

	return elem;

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

		return;

	if(typeof newLayer == "string")
		this.elem = JSFX.createElem(newLayer);
	else
		this.elem=newLayer;

	if(document.layers)
	{
		this.images=this.elem.document.images; 
		this.style = this.elem;
 	} 
	else 
	{
		this.images  = document.images; 
		this.style   = this.elem.style; 
	} 
} 
/**********************************************************************************/
var ns4 = (navigator.appName.indexOf("Netscape") != -1 && !document.getElementById);

/**********************************************************************************/
/*** moveTo (x,y) ***/
JSFX.Layer.prototype.moveTo = function(x,y)
{
	this.style.left = x+"px";
	this.style.top = y+"px";
}
if(ns4)
	JSFX.Layer.prototype.moveTo = function(x,y) { this.elem.moveTo(x,y); }
/**********************************************************************************/
/*** show()/hide() Visibility ***/
JSFX.Layer.prototype.show		= function() 	{ this.style.visibility = "visible"; } 
JSFX.Layer.prototype.hide		= function() 	{ this.style.visibility = "hidden"; } 
if(ns4)
{
	JSFX.Layer.prototype.show		= function() 	{ this.style.visibility = "show"; }
	JSFX.Layer.prototype.hide 		= function() 	{ this.style.visibility = "hide"; }
}
/**********************************************************************************/
/*** zIndex ***/
JSFX.Layer.prototype.setzIndex	= function(z)	{ this.style.zIndex = z; } 
/*** Opacity ***/
if(document.all)
{
	JSFX.Layer.prototype.setOpacity = function(pc)
	{
		if(this.style.filter=="")
			this.style.filter="alpha(opacity=100);";
		this.elem.filters.alpha.opacity=pc;
	}
}
else
	JSFX.Layer.prototype.setOpacity = function(pc) {return 0;}
/******* END OF CODE FROM JSFX.Layer.js ***/
/*** START OF CODE FROM JSFX.Browser.js ***/
JSFX.Browser = new Object();

if(navigator.appName.indexOf("Netscape") != -1)

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

		else
			parent=parent.elem;

		xName="xLayer" + JSFX.layerNo++;
		txt = ""
			+ "position:absolute;left:0px;top:0px;visibility:hidden";

		var newRange = document.createRange();

		elem = document.createElement("DIV");
		elem.setAttribute("style",txt);
		elem.setAttribute("id", xName);

		parent.appendChild(elem);

		newRange.setStartBefore(elem);
		strFrag = newRange.createContextualFragment(htmlStr);	
		elem.appendChild(strFrag);
	}

	return elem;

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


	if(typeof newLayer == "string")
		this.elem = JSFX.createLayer(newLayer, parent);
	else
		this.elem=newLayer;

	if(document.layers)
	{
		this.images		= this.elem.document.images; 
		this.parent		= parent;
		this.style		= this.elem;
		if(parent != null)
			this.style.visibility = "inherit";
 	} 
	else 
	{
		this.images  = document.images; 
		this.parent	 = parent;
		this.style   = this.elem.style; 
	} 
	window[this.elem.id]=this;	//save a reference to this
} 
/**********************************************************************************/
JSFX.findLayer = function(theDiv, d)
{
	if(document.layers)
	{
		var i;
		if(d==null) d = document;

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

	if(document.getElementById)
		return(document.getElementById(theDiv));
	else
		return("Undefined.....");
}

/**********************************************************************************/
/*** moveTo (x,y) ***/
JSFX.Layer.prototype.moveTo = function(x,y)
{
	this.style.left = x+"px";
	this.style.top = y+"px";
}
if(ns4)
	JSFX.Layer.prototype.moveTo = function(x,y) { this.elem.moveTo(x,y); }
/**********************************************************************************/
/*** show()/hide() Visibility ***/
JSFX.Layer.prototype.show		= function() 	{ this.style.visibility = "visible"; } 
JSFX.Layer.prototype.hide		= function() 	{ this.style.visibility = "hidden"; } 
JSFX.Layer.prototype.isVisible	= function()	{ return this.style.visibility == "visible"; } 
if(ns4)
{
	JSFX.Layer.prototype.show		= function() 	{ this.style.visibility = "show"; }
	JSFX.Layer.prototype.hide 		= function() 	{ this.style.visibility = "hide"; }
	JSFX.Layer.prototype.isVisible 	= function() 	{ return this.style.visibility == "show"; }
}
/**********************************************************************************/
/*** zIndex ***/
JSFX.Layer.prototype.setzIndex	= function(z)	{ this.style.zIndex = z; } 
JSFX.Layer.prototype.getzIndex	= function()	{ return this.style.zIndex; }
/**********************************************************************************/
/*** ForeGround (text) Color ***/
JSFX.Layer.prototype.setColor	= function(c){this.style.color=c;}
if(ns4)
	JSFX.Layer.prototype.setColor	= function(c)
	{
		this.elem.document.write("<FONT COLOR='"+c+"'>"+this.elem.innerHTML+"</FONT>");
		this.elem.document.close();
	}
/**********************************************************************************/
/*** BackGround Color ***/
JSFX.Layer.prototype.setBgColor	= function(color) { this.style.backgroundColor = color==null?'transparent':color; } 
if(ns4)
	JSFX.Layer.prototype.setBgColor 	= function(color) { this.elem.bgColor = color; }
/**********************************************************************************/
/*** BackGround Image ***/
JSFX.Layer.prototype.setBgImage	= function(image) { this.style.backgroundImage = "url("+image+")"; }
if(ns4)
	JSFX.Layer.prototype.setBgImage 	= function(image) { this.style.background.src = image; }
/**********************************************************************************/
/*** set Content***/
JSFX.Layer.prototype.setContent   = function(xHtml)	{ this.elem.innerHTML=xHtml; } 
if(ns4)
	JSFX.Layer.prototype.setContent   = function(xHtml)
	{
		this.elem.document.write(xHtml);
		this.elem.document.close();
		this.elem.innerHTML = xHtml;
	}

/**********************************************************************************/
/*** Clipping ***/
JSFX.Layer.prototype.clip = function(x1,y1, x2,y2){ this.style.clip="rect("+y1+" "+x2+" "+y2+" "+x1+")"; }
if(ns4)
	JSFX.Layer.prototype.clip = function(x1,y1, x2,y2)
	{
		this.style.clip.top	=y1;
		this.style.clip.left	=x1;
		this.style.clip.bottom	=y2;
		this.style.clip.right	=x2;
	}
/**********************************************************************************/
/*** Resize ***/
JSFX.Layer.prototype.resizeTo = function(w,h)
{ 
	this.style.width	=w + "px";
	this.style.height	=h + "px";
}
if(ns4)
	JSFX.Layer.prototype.resizeTo = function(w,h)
	{
		this.style.clip.width	=w;
		this.style.clip.height	=h;
	}
/**********************************************************************************/
/*** getX/Y ***/
JSFX.Layer.prototype.getX	= function() 	{ return parseInt(this.style.left); }
JSFX.Layer.prototype.getY	= function() 	{ return parseInt(this.style.top); }
if(ns4)
{
	JSFX.Layer.prototype.getX	= function() 	{ return this.style.left; }
	JSFX.Layer.prototype.getY	= function() 	{ return this.style.top; }
}
/**********************************************************************************/
/*** getWidth/Height ***/
JSFX.Layer.prototype.getWidth		= function() 	{ return this.elem.offsetWidth; }
JSFX.Layer.prototype.getHeight	= function() 	{ return this.elem.offsetHeight; }
if(!document.getElementById)
	JSFX.Layer.prototype.getWidth		= function()
 	{ 
		//Extra processing here for clip
		return this.elem.scrollWidth;
	}

if(ns4)
{
	JSFX.Layer.prototype.getWidth		= function() 	{ return this.style.clip.right; }
	JSFX.Layer.prototype.getHeight	= function() 	{ return this.style.clip.bottom; }
}
/**********************************************************************************/
/*** Opacity ***/
if(ns4)
{
	JSFX.Layer.prototype.setOpacity = function(pc) {return 0;}
}
else if(document.all)
{
	JSFX.Layer.prototype.setOpacity = function(pc)
	{
		if(this.style.filter=="")
			this.style.filter="alpha(opacity=100);";
		this.elem.filters.alpha.opacity=pc;
	}
}
else
{
/*** Assume NS6 ***/
	JSFX.Layer.prototype.setOpacity = function(pc){	this.style.MozOpacity=pc+'%' }
}
/**************************************************************************/
/*** Event Handling - Start ***/
/*** NS4 ***/
if(ns4)
{
	JSFX.eventmasks = {
	      onabort:Event.ABORT, onblur:Event.BLUR, onchange:Event.CHANGE,
	      onclick:Event.CLICK, ondblclick:Event.DBLCLICK, 
	      ondragdrop:Event.DRAGDROP, onerror:Event.ERROR, 

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

// Please DO NOT link directly to my .js files from your site. Copy
// the files to your server and use them there. Thank you.
// ===================================================================

function PopupWindow_getXYPosition(anchorname){var coordinates;if(this.type == "WINDOW"){coordinates = getAnchorWindowPosition(anchorname);}else{coordinates = getAnchorPosition(anchorname);}this.x = coordinates.x;this.y = coordinates.y;}
function PopupWindow_setSize(width,height){this.width = width;this.height = height;}
function PopupWindow_populate(contents){this.contents = contents;this.populated = false;}
function PopupWindow_setUrl(url){this.url = url;}
function PopupWindow_setWindowProperties(props){this.windowProperties = props;}
function PopupWindow_refresh(){if(this.divName != null){if(this.use_gebi){document.getElementById(this.divName).innerHTML = this.contents;}else if(this.use_css){document.all[this.divName].innerHTML = this.contents;}else if(this.use_layers){var d = do...
function PopupWindow_showPopup(anchorname){this.getXYPosition(anchorname);this.x += this.offsetX;this.y += this.offsetY;if(!this.populated &&(this.contents != "")){this.populated = true;this.refresh();}if(this.divName != null){if(this.use_gebi){docum...
function PopupWindow_hidePopup(){if(this.divName != null){if(this.use_gebi){document.getElementById(this.divName).style.visibility = "hidden";}else if(this.use_css){document.all[this.divName].style.visibility = "hidden";}else if(this.use_layers){docu...
function PopupWindow_isClicked(e){if(this.divName != null){if(this.use_layers){var clickX = e.pageX;var clickY = e.pageY;var t = document.layers[this.divName];if((clickX > t.left) &&(clickX < t.left+t.clip.width) &&(clickY > t.top) &&(clickY < t.top+...
function PopupWindow_hideIfNotClicked(e){if(this.autoHideEnabled && !this.isClicked(e)){this.hidePopup();}}
function PopupWindow_autoHide(){this.autoHideEnabled = true;}
function PopupWindow_hidePopupWindows(e){for(var i=0;i<popupWindowObjects.length;i++){if(popupWindowObjects[i] != null){var p = popupWindowObjects[i];p.hideIfNotClicked(e);}}}
function PopupWindow_attachListener(){if(document.layers){document.captureEvents(Event.MOUSEUP);}window.popupWindowOldEventListener = document.onmouseup;if(window.popupWindowOldEventListener != null){document.onmouseup = new Function("window.popupWin...
function PopupWindow(){if(!window.popupWindowIndex){window.popupWindowIndex = 0;}if(!window.popupWindowObjects){window.popupWindowObjects = new Array();}if(!window.listenerAttached){window.listenerAttached = true;PopupWindow_attachListener();}this.in...

applications/htmlroot/cgi-bin/detailedStatisticsReportGenerationAndCompareResponsetimeTrends.pl  view on Meta::CPAN

  if ( $formatOutput eq 'pdf' and ! $htmlToPdf ) {
    my $url = "$HTTPSURL/cgi-bin/htmlToPdf.pl?HTMLtoPDFprg=$HTMLTOPDFPRG&amp;HTMLtoPDFhow=$HTMLTOPDFHOW&amp;scriptname=". $ENV{SCRIPT_NAME} ."&amp;". encode_html_entities('U', $urlAccessParameters);

    print <<EndOfHtml;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">  
<html>
<head>
  <title>$htmlTitle</title>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
  <META HTTP-EQUIV="refresh" content="1;url=$url">
  <link rel="stylesheet" type="text/css" href="$HTTPSURL/asnmtap.css">
</head>
<BODY>
</BODY>
</HTML>
EndOfHtml

    exit;
  }

  my ($rv, $dbh, $sth, $uKey, $sqlQuery, $sqlSelect, $sqlAverage, $sqlInfo, $sqlErrors, $sqlWhere, $sqlPeriode);

applications/htmlroot/cgi-bin/detailedStatisticsReportGenerationAndCompareResponsetimeTrends.pl  view on Meta::CPAN


      $sth->finish() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->finish", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', $sessionID);

      if ($htmlToPdf) {
        print <<EndOfHtml;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">  
<html>
<head>
  <title>$htmlTitle</title>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
  <link rel="stylesheet" type="text/css" href="$HTTPSURL/asnmtap.css">
</head>
<BODY TEXT="#000000">
EndOfHtml
      } else {
        print_header (*STDOUT, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', 'F', "<script type=\"text/javascript\" language=\"JavaScript\" src=\"$HTTPSURL/AnchorPosition.js\"></script>\n  <script type=\"text/javascript\" language=\"JavaScript...
      }

      # Section: FromTo
      $dummy  = ($inputType eq "fromto") ? ' checked' : '';
      $fromto = "<input type=\"radio\" name=\"inputType\" value=\"fromto\"$dummy>From:";

applications/htmlroot/cgi-bin/moderator/collectorCrontabSchedulingReports.pl  view on Meta::CPAN


  if ( $rv ) {
    # HTML  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    if ($htmlToPdf) {
      print <<EndOfHtml;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">  
<html>
<head>
  <title>$htmlTitle</title>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
  <link rel="stylesheet" type="text/css" href="$HTTPSURL/asnmtap.css">
</head>
<BODY>
<H1>$DEPARTMENT \@ $BUSINESS: '$APPLICATION' $prgtext</H1>
EndOfHtml
    } else {
      print_header (*STDOUT, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', 'F', '', $sessionID);

      my $dummy = ($currentTimeslot eq 'on') ? ' checked' : '';
      my $currentTimeslotOutputBox = "<input type=\"checkbox\" name=\"currentTimeslot\"$dummy>Endpoint used from latest timeslot\n";

applications/htmlroot/cgi-bin/moderator/collectorDaemonSchedulingReports.pl  view on Meta::CPAN


  if ( $rv ) {
    # HTML  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    if ($htmlToPdf) {
      print <<EndOfHtml;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">  
<html>
<head>
  <title>$htmlTitle</title>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
  <link rel="stylesheet" type="text/css" href="$HTTPSURL/asnmtap.css">
</head>
<BODY>
<H1>$DEPARTMENT \@ $BUSINESS: '$APPLICATION' $prgtext</H1>
EndOfHtml
    } else {
      print_header (*STDOUT, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', 'F', '', $sessionID);

      my $dummy = ($currentTimeslot eq 'on') ? ' checked' : '';
      my $currentTimeslotOutputBox = "<input type=\"checkbox\" name=\"currentTimeslot\"$dummy>Endpoint used from latest timeslot\n";

applications/htmlroot/cgi-bin/moderator/pluginCrontabSchedulingReports.pl  view on Meta::CPAN


  if ( $rv ) {
    # HTML  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    if ($htmlToPdf) {
      print <<EndOfHtml;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">  
<html>
<head>
  <title>$htmlTitle</title>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
  <link rel="stylesheet" type="text/css" href="$HTTPSURL/asnmtap.css">
</head>
<BODY>
<H1>$DEPARTMENT \@ $BUSINESS: '$APPLICATION' $prgtext</H1>
EndOfHtml
    } else {
      print_header (*STDOUT, $pagedir, $pageset, $htmlTitle, $subTitle, 3600, '', 'F', '', $sessionID);

      my $dummy = ($pf eq 'on') ? ' checked' : '';
      my $printerFriendlyOutputBox = "<input type=\"checkbox\" name=\"pf\"$dummy> Printer friendly output\n";

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

	parseTokens('ol_', overlib_pagedefaults.arguments);
}


////////
// OVERLIB MAIN FUNCTION
////////

// This function decides what it is we want to display and how we want it done.
function olMain() {
	var layerhtml, styleType;
 	runHook("olMain", FBEFORE);
 	
	if (o3_background!="" || o3_fullhtml) {
		// Use background instead of box.
		layerhtml = runHook('ol_content_background', FALTERNATE, o3_css, o3_text, o3_background, o3_fullhtml);
	} else {
		// They want a popup box.
		styleType = (pms[o3_css-1-pmStart] == "cssoff" || pms[o3_css-1-pmStart] == "cssclass");

		// Prepare popup background
		if (o3_fgbackground != "") o3_fgbackground = "background=\""+o3_fgbackground+"\"";
		if (o3_bgbackground != "") o3_bgbackground = (styleType ? "background=\""+o3_bgbackground+"\"" : o3_bgbackground);

		// Prepare popup colors
		if (o3_fgcolor != "") o3_fgcolor = (styleType ? "bgcolor=\""+o3_fgcolor+"\"" : o3_fgcolor);
		if (o3_bgcolor != "") o3_bgcolor = (styleType ? "bgcolor=\""+o3_bgcolor+"\"" : o3_bgcolor);

		// Prepare popup height
		if (o3_height > 0) o3_height = (styleType ? "height=\""+o3_height+"\"" : o3_height);
		else o3_height = "";

		// Decide which kinda box.
		if (o3_cap=="") {
			// Plain
			layerhtml = runHook('ol_content_simple', FALTERNATE, o3_css, o3_text);
		} else {
			// With caption
			if (o3_sticky) {
				// Show close text

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

}

////////
// LAYER GENERATION FUNCTIONS
////////
// These functions just handle popup content with tags that should adhere to the W3C standards specification.

// Makes simple table without caption
function ol_content_simple(text) {
	var cpIsMultiple = /,/.test(o3_cellpad);
	var txt = '<table width="'+o3_width+ '" border="0" cellpadding="'+o3_border+'" cellspacing="0" '+(o3_bgclass ? 'class="'+o3_bgclass+'"' : o3_bgcolor+' '+o3_height)+'><tr><td><table width="100%" border="0" '+((olNs4||!cpIsMultiple) ? 'cellpadding="'+...

	set_background("");
	return txt;
}

// Makes table with caption and optional close link
function ol_content_caption(text,title,close) {
	var nameId, txt, cpIsMultiple = /,/.test(o3_cellpad);
	var closing, closeevent;

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

	closeevent = "onmouseover";
	if (o3_closeclick == 1) closeevent = (o3_closetitle ? "title='" + o3_closetitle +"'" : "") + " onclick";
	if (o3_capicon != "") {
	  nameId = ' hspace = \"5\"'+' align = \"middle\" alt = \"\"';
	  if (typeof o3_dragimg != 'undefined' && o3_dragimg) nameId =' hspace=\"5\"'+' name=\"'+o3_dragimg+'\" id=\"'+o3_dragimg+'\" align=\"middle\" alt=\"Drag Enabled\" title=\"Drag Enabled\"';
	  o3_capicon = '<img src=\"'+o3_capicon+'\"'+nameId+' />';
	}

	if (close != "")
		closing = '<td '+(!o3_compatmode && o3_closefontclass ? 'class="'+o3_closefontclass : 'align="RIGHT')+'"><a href="javascript:return '+fnRef+'cClick();"'+((o3_compatmode && o3_closefontclass) ? ' class="' + o3_closefontclass + '" ' : ' ')+closeevent...
	txt = '<table width="'+o3_width+ '" border="0" cellpadding="'+o3_border+'" cellspacing="0" '+(o3_bgclass ? 'class="'+o3_bgclass+'"' : o3_bgcolor+' '+o3_bgbackground+' '+o3_height)+'><tr><td><table width="100%" border="0" cellpadding="2" cellspacing=...

	set_background("");
	return txt;
}

// Sets the background picture,padding and lots more. :)
function ol_content_background(text,picture,hasfullhtml) {
	if (hasfullhtml) {
		txt=text;
	} else {

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


	set_background(picture);
	return txt;
}

// Loads a picture into the div.
function set_background(pic) {
	if (pic == "") {
		if (olNs4) {
			over.background.src = null; 
		} else if (over.style) {
			over.style.backgroundImage = "none";
		}
	} else {
		if (olNs4) {
			over.background.src = pic;
		} else if (over.style) {
			over.style.width=o3_width + 'px';
			over.style.backgroundImage = "url("+pic+")";
		}
	}
}

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

// Displays the popup

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

	runHook("disp", FAFTER);

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

// Creates the actual popup structure
function createPopup(lyrContent){
	runHook("createPopup", FBEFORE);
	
	if (o3_wrap) {
		var wd,ww,theObj = (olNs4 ? over : over.style);
		theObj.top = theObj.left = ((olIe4&&!olOp) ? 0 : -10000) + (!olNs4 ? 'px' : 0);
		layerWrite(lyrContent);
		wd = (olNs4 ? over.clip.width : over.offsetWidth);
		if (wd > (ww=windowWidth())) {
			lyrContent=lyrContent.replace(/\&nbsp;/g, ' ');
			o3_width=ww;
			o3_wrap=0;
		} 
	}

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

		}
		
		over.appendChild(domfrag);
	}
}

// Make an object visible
function showObject(obj) {
	runHook("showObject", FBEFORE);

	var theObj=(olNs4 ? obj : obj.style);
	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 = "";

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

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

	runHook("hideObject", FAFTER);
}

// Move a layer
function repositionTo(obj, xL, yL) {
	var theObj=(olNs4 ? obj : obj.style);
	theObj.left = xL + (!olNs4 ? 'px' : 0);
	theObj.top = yL + (!olNs4 ? 'px' : 0);
}

// Check position of cursor relative to overDiv DIVision; mouseOut function
function cursorOff() {
	var left = parseInt(over.style.left);
	var top = parseInt(over.style.top);
	var right = left + (over.offsetWidth >= parseInt(o3_width) ? over.offsetWidth : parseInt(o3_width));
	var bottom = top + (over.offsetHeight >= o3_aboveheight ? over.offsetHeight : o3_aboveheight);

	if (o3_x < left || o3_x > right || o3_y < top || o3_y > bottom) return true;

	return false;
}


////////

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

//    endWrap true(if end tag) or false if start tag
//    fontSizeStr - font size string such as '1' or '10px'
//    whichString is being wrapped -- 'text', 'caption', or 'close'
function wrapStr(endWrap,fontSizeStr,whichString) {
	var fontStr, fontColor, isClose=((whichString=='close') ? 1 : 0), hasDims=/[%\-a-z]+$/.test(fontSizeStr);
	fontSizeStr = (olNs4) ? (!hasDims ? fontSizeStr : '1') : fontSizeStr;
	if (endWrap) return (hasDims&&!olNs4) ? (isClose ? '</span>' : '</div>') : '</font>';
	else {
		fontStr='o3_'+whichString+'font';
		fontColor='o3_'+((whichString=='caption')? 'cap' : whichString)+'color';
		return (hasDims&&!olNs4) ? (isClose ? '<span style="font-family: '+quoteMultiNameFonts(eval(fontStr))+'; color: '+eval(fontColor)+'; font-size: '+fontSizeStr+';">' : '<div style="font-family: '+quoteMultiNameFonts(eval(fontStr))+'; color: '+eval(fo...
	}
}

// Quotes Multi word font names; needed for CSS Standards adherence in font-family
function quoteMultiNameFonts(theFont) {
	var v, pM=theFont.split(',');
	for (var i=0; i<pM.length; i++) {
		v=pM[i];
		v=v.replace(/^\s+/,'').replace(/\s+$/,'');
		if(/\s/.test(v) && !/['"]/.test(v)) {

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

		}
	}
	return pM.join();
}

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

// Sets cellpadding style string value
function setCellPadStr(parameter) {
	var Str='', j=0, ary = new Array(), top, bottom, left, right;

	Str+='padding: ';
	ary=parameter.replace(/\s+/g,'').split(',');

	switch(ary.length) {
		case 2:
			top=bottom=ary[j];
			left=right=ary[++j];

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

		} else {
			var body = (olIe4 ? frm.document.all.tags('BODY')[0] : frm.document.getElementsByTagName("BODY")[0]);
			if (olIe4&&!document.getElementById) {
				body.insertAdjacentHTML("beforeEnd",'<div id="'+id+'"></div>');
				divContainer=layerReference(id);
			} else {
				divContainer = frm.document.createElement("DIV");
				divContainer.id = id;
				body.appendChild(divContainer);
			}
			objRef = divContainer.style;
		}

		objRef.position = 'absolute';
		objRef.visibility = 'hidden';
		objRef.zIndex = zValue;
		if (olIe4&&!olOp) objRef.left = objRef.top = '0px';
		else objRef.left = objRef.top =  -10000 + (!olNs4 ? 'px' : 0);
	}

	return divContainer;

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

//\/////
//\mini


////////
// PRE-INIT
// Ignore these lines, configuration is below.
////////
if (typeof olInfo == 'undefined' || typeof olInfo.meets == 'undefined' || !olInfo.meets(4.10)) alert('overLIB 4.10 or later is required for the CSS Style Plugin.');
else {
registerCommands('cssstyle,padunit,heightunit,widthunit,textsizeunit,textdecoration,textstyle,textweight,captionsizeunit,captiondecoration,captionstyle,captionweight,closesizeunit,closedecoration,closestyle,closeweight');


////////
// DEFAULT CONFIGURATION
// Settings you want everywhere are set here. All of this can also be
// changed on your html page or through an overLIB call.
////////
if (typeof ol_padunit=='undefined') var ol_padunit="px";
if (typeof ol_heightunit=='undefined') var ol_heightunit="px";
if (typeof ol_widthunit=='undefined') var ol_widthunit="px";
if (typeof ol_textsizeunit=='undefined') var ol_textsizeunit="px";
if (typeof ol_textdecoration=='undefined') var ol_textdecoration="none";
if (typeof ol_textstyle=='undefined') var ol_textstyle="normal";
if (typeof ol_textweight=='undefined') var ol_textweight="normal";
if (typeof ol_captionsizeunit=='undefined') var ol_captionsizeunit="px";
if (typeof ol_captiondecoration=='undefined') var ol_captiondecoration="none";
if (typeof ol_captionstyle=='undefined') var ol_captionstyle="normal";
if (typeof ol_captionweight=='undefined') var ol_captionweight="bold";
if (typeof ol_closesizeunit=='undefined') var ol_closesizeunit="px";
if (typeof ol_closedecoration=='undefined') var ol_closedecoration="none";
if (typeof ol_closestyle=='undefined') var ol_closestyle="normal";
if (typeof ol_closeweight=='undefined') var ol_closeweight="normal";

////////
// END OF CONFIGURATION
// Don't change anything below this line, all configuration is above.
////////



////////
// INIT
////////
// Runtime variables init. Don't change for config!
var o3_padunit="px";
var o3_heightunit="px";
var o3_widthunit="px";
var o3_textsizeunit="px";
var o3_textdecoration="";
var o3_textstyle="";
var o3_textweight="";
var o3_captionsizeunit="px";
var o3_captiondecoration="";
var o3_captionstyle="";
var o3_captionweight="";
var o3_closesizeunit="px";
var o3_closedecoration="";
var o3_closestyle="";
var o3_closeweight="";


////////
// PLUGIN FUNCTIONS
////////

// Function which sets runtime variables to their default values
function setCSSStyleVariables() {
	o3_padunit=ol_padunit;
	o3_heightunit=ol_heightunit;
	o3_widthunit=ol_widthunit;
	o3_textsizeunit=ol_textsizeunit;
	o3_textdecoration=ol_textdecoration;
	o3_textstyle=ol_textstyle;
	o3_textweight=ol_textweight;
	o3_captionsizeunit=ol_captionsizeunit;
	o3_captiondecoration=ol_captiondecoration;
	o3_captionstyle=ol_captionstyle;
	o3_captionweight=ol_captionweight;
	o3_closesizeunit=ol_closesizeunit;
	o3_closedecoration=ol_closedecoration;
	o3_closestyle=ol_closestyle;
	o3_closeweight=ol_closeweight;
}

// Parses CSS Style commands.
function parseCSSStyleExtras(pf, i, ar) {
	var k = i;
	
	if (k < ar.length) {
		if (ar[k]==CSSSTYLE) { eval(pf+'css='+ar[k]); return k; }
		if (ar[k]==PADUNIT) { eval(pf+'padunit="'+ar[++k]+'"'); return k; }
		if (ar[k]==HEIGHTUNIT) { eval(pf+'heightunit="'+ar[++k]+'"'); return k; }
		if (ar[k]==WIDTHUNIT) { eval(pf+'widthunit="'+ar[++k]+'"'); return k; }
		if (ar[k]==TEXTSIZEUNIT) { eval(pf+'textsizeunit="'+ar[++k]+'"'); return k; }
		if (ar[k]==TEXTDECORATION) { eval(pf+'textdecoration="'+ar[++k]+'"'); return k; }
		if (ar[k]==TEXTSTYLE) { eval(pf+'textstyle="'+ar[++k]+'"'); return k; }
		if (ar[k]==TEXTWEIGHT) { eval(pf+'textweight="'+ar[++k]+'"'); return k; }
		if (ar[k]==CAPTIONSIZEUNIT) { eval(pf+'captionsizeunit="'+ar[++k]+'"'); return k; }
		if (ar[k]==CAPTIONDECORATION) { eval(pf+'captiondecoration="'+ar[++k]+'"'); return k; }
		if (ar[k]==CAPTIONSTYLE) { eval(pf+'captionstyle="'+ar[++k]+'"'); return k; }
		if (ar[k]==CAPTIONWEIGHT) { eval(pf+'captionweight="'+ar[++k]+'"'); return k; }
		if (ar[k]==CLOSESIZEUNIT) { eval(pf+'closesizeunit="'+ar[++k]+'"'); return k; }
		if (ar[k]==CLOSEDECORATION) { eval(pf+'closedecoration="'+ar[++k]+'"'); return k; }
		if (ar[k]==CLOSESTYLE) { eval(pf+'closestyle="'+ar[++k]+'"'); return k; }
		if (ar[k]==CLOSEWEIGHT) { eval(pf+'closeweight="'+ar[++k]+'"'); return k; }
	}
	
	return -1;
}

////////
// LAYER GENERATION FUNCTIONS
////////

// Makes simple table without caption
function ol_content_simple_cssstyle(text) {
	txt = '<table width="'+o3_width+ '" border="0" cellpadding="'+o3_border+'" cellspacing="0" style="background-color: '+o3_bgcolor+'; height: '+o3_height+o3_heightunit+';"><tr><td><table width="100%" border="0" cellpadding="' + o3_cellpad + '" cellspa...
	set_background("");
	
	return txt;
}

// Makes table with caption and optional close link
function ol_content_caption_cssstyle(text, title, close) {
	var nameId;
	closing = "";
	closeevent = "onMouseOver";
	
	if (o3_closeclick == 1) closeevent= (o3_closetitle ? "title='" + o3_closetitle +"'" : "") + " onClick";

	if (o3_capicon!="") {
		nameId=' hspace=\"5\"'+' align=\"middle\" alt=\"\"';
		if (typeof o3_dragimg != 'undefined' && o3_dragimg) nameId = ' hspace=\"5\"'+' name=\"'+o3_dragimg+'\" id=\"'+o3_dragimg+'\" align=\"middle\" alt=\"Drag Enabled\" title=\"Drag Enabled\"';
		o3_capicon = '<img src=\"'+o3_capicon+'\"'+nameId+' />';
	}
	
	if (close != "") {
		closing = '<td align="RIGHT"><a href="javascript:return '+fnRef+'cClick();" '+closeevent+'="return '+fnRef+'cClick();" style="color: '+o3_closecolor+'; font-family: '+o3_closefont+'; font-size: '+o3_closesize+o3_closesizeunit+'; text-decoration: '+...
	}
	
	txt = '<table width="'+o3_width+ '" border="0" cellpadding="'+o3_border+'" cellspacing="0" style="background-color: '+o3_bgcolor+'; background-image: url('+o3_bgbackground+'); height: '+o3_height+o3_heightunit+';"><tr><td><table width="100%" border=...
	set_background("");

	return txt;
}

// Sets the background picture, padding and lots more. :)
function ol_content_background_cssstyle(text, picture, hasfullhtml) {
	if (hasfullhtml) {
		txt = text;
	} else {
		var pU, hU, wU;
		pU = (o3_padunit == '%' ? '%' : '');
		hU = (o3_heightunit == '%' ? '%' : '');
		wU = (o3_widthunit == '%' ? '%' : '');
		txt = '<table width="'+o3_width+wu+'" border="0" cellpadding="0" cellspacing="0" height="'+o3_height+hu+'"><tr><td colspan="3" height="'+o3_padyt+pu+'"></td></tr><tr><td width="'+o3_padxl+pu+'"></td><td valign="TOP" width="'+(o3_width-o3_padxl-o3_p...
	}

	set_background(picture);

	return txt;
}

////////
// PLUGIN REGISTRATIONS
////////
registerRunTimeFunction(setCSSStyleVariables);
registerCmdLineFunction(parseCSSStyleExtras);
registerHook("ol_content_simple", ol_content_simple_cssstyle, FALTERNATE, CSSSTYLE);
registerHook("ol_content_caption", ol_content_caption_cssstyle, FALTERNATE, CSSSTYLE);
registerHook("ol_content_background", ol_content_background_cssstyle, FALTERNATE, CSSSTYLE);
}

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

		istrt = 1;
		theDiv = args[0];
	}

	sho = createDivContainer(theDiv);

	if (olNs4) {
		shoObj = sho;
		txt += '<table cellpadding="1" cellspacing="0" border="0" bgcolor="#000000"><tr><td>';
	} else {
		with(sho.style) {
			backgroundColor = '#ffffcc';
			padding = '5px';
			border = '1px #000000 solid';
		}
		shoObj = sho.style;
	}

	lvl = getLayerLevel(theDiv);

	if(typeof sho.position == 'undefined') {
		sho.position = new Pagelocation(10 + lvl*20, 10, 1);
		if(typeof olZindex == 'undefined') olZindex = getDivZindex();
		shoObj.zIndex = olZindex + 1 + lvl;
	}

	txt += '<table cellpadding="5" border="0" cellspacing="0"' + (olNs4 ? ' bgcolor="#ffffcc"' : '') + '>';
	txt += '<tr><td><strong><A HREF="javascript:moveToBack(\'' + theDiv + '\');" title="Move to back">' + theDiv + '</A></strong></td><td align="RIGHT"><strong><a href="javascript:closeLayer(\'' + theDiv + '\');" TITLE="Close Layer' + (!olNs4 ? '" style...
	txt += '<tr><td style="text-decoration: underline;"><strong>Item</strong></td><td style="text-decoration: underline;"><strong>Value</strong></td></tr>';
	for (var i = istrt; i<args.length-1; i++) 
		txt += '<tr><td align="right"><strong>' + args[i] + ':&nbsp;</strong></td><td>' + args[++i] + '</td></tr>';
	txt += '</table>' + (olNs4 ? '</td></tr></table>' : '');

	if (olNs4) {
		sho.document.open();
		sho.document.write(txt);
		sho.document.close();
	} else {
		if(olIe5&&isMac) sho.innerHTML = '';

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

	}

	return i;
}
function getDivZindex(id) {
	var obj;

	if(id == '' || id == null) id = 'overDiv';

	obj = layerReference(id);
	obj = (olNs4 ? obj : obj.style);

	return obj.zIndex;
}
function setCanShowParm(debugID) {
	var lyr, pLyr;

	if(typeof debugID != 'string') return;

	pLyr = debugID.split(',');
	for(var i = 0; i<pLyr.length; i++) {

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

function Pagelocation(x, y, canShow) {
	this.x = x;
	this.y = y;
  this.canShow = (canShow == null) ? 0 : canShow;
}
function showAllVisibleLayers(){
	var lyr, lyrObj, l = document.popups;

	for (var i = 0; i<l.length; i++) {
		lyr = layerReference(l[i]);
		lyrObj = (olNs4 ? lyr : lyr.style);
    if(lyr.position.canShow) {
  		positionLayer(lyrObj, lyr.position.x, lyr.position.y);
  		lyrObj.visibility = 'visible';
    }
	}
}
function positionLayer(Obj, x, y) { // Obj is obj.style for IE/NS6+ but obj for NS4
	Obj.left = x + (olIe4 ? eval(docRoot + '.scrollLeft') : window.pageXOffset) + (olNs4 ? 0 : 'px');
	Obj.top = y + (olIe4 ? eval(docRoot + '.scrollTop') : window.pageYOffset) + (olNs4 ? 0 : 'px');
}
function closeLayer(lyrID) {
	var lyr = layerReference(lyrID);

  lyr.position.canShow = 0;
	lyr = (olNs4 ? lyr : lyr.style);
	lyr.visibility = 'hidden';
}
function moveToBack(layer) {
	var l = document.popups, lyr, obj, i, x = 10, y = 10, dx = 20, z = olZindex + 1;

	if(l.length == 1) return;

	lyr = layerReference(layer);
	lyr.position.x = x;
	lyr.position.y = y;
	obj = (olNs4 ? lyr : lyr.style);
	obj.zIndex = z;

	for (i = 0; i<l.length; i++) {
		if (layer == l[i]) continue;
		lyr = layerReference(l[i]);
    if(lyr.position.canShow == 0) continue;
		obj = (olNs4 ? lyr : lyr.style);
		obj.zIndex += 1;
		lyr.position.x += dx;
		lyr.position.y = y;
	}

	showAllVisibleLayers();
}
function rawTxt(txt) {
	if (typeof txt != 'string') return;
	return txt.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");

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

}
function getPageScrollX() {
	if (o3_frame.pageXOffset) return o3_frame.pageXOffset;
	if (eval(docRoot)) return eval('o3_frame.'+docRoot+'.scrollLeft');
	return -1;
}

// Find out where our layer is
function getLayerTop(layer) {
	if (layer.pageY) return layer.pageY;
	if (layer.style.top) return parseInt(layer.style.top);
	return -1;
}
function getLayerLeft(layer) {
	if (layer.pageX) return layer.pageX;
	if (layer.style.left) return parseInt(layer.style.left);
	return -1;
}

// Repositions the layer if needed
function repositionOver() {
	var X, Y, pgLeft, pgTop;
	pgTop = getPageScrollY();
	pgLeft = getPageScrollX();
	X = getLayerLeft(over)-pgLeft;
	Y = getLayerTop(over)-pgTop;

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


// Function which generates the popup with an IFRAME shim
function generatePopUp(content) {
	if(!olIe4||olOp||!olIe55||(typeof o3_shadow != 'undefined' && o3_shadow)||(typeof o3_bubble != 'undefined' && o3_bubble)) return;

	var wd,ht,txt, zIdx =  0;

	wd =  parseInt(o3_width);
	ht =  over.offsetHeight;
	txt =  backDropSource(wd,ht,zIdx++);
	txt += '<div style="position: absolute; top: 0; left: 0; width: '+ wd+'px; z-index: ' + zIdx + ';">' + content + '</div>';
	layerWrite(txt);
}

// Code for the IFRAME which is used in other places
function backDropSource(width, height, Z) {
	return '<iframe frameborder="0" scrolling="no" src="javascript:false;" width="' + width + '" height="' + height + '" style="z-index: ' + Z + '; filter: Beta(Style=0,Opacity=0);"></iframe>';
}

// Hides SELECT boxes that will be under the popup
// Checking Gecko version number to try to include other browsers based on the Gecko engine
function hideSelectBox() {
	if(olNs4 || olOp || olIe55) return;
	var px, py, pw, ph, sx, sw, sy, sh, selEl, v;

	if(olIe4) v = 0;
	else {
		v = navigator.userAgent.match(/Gecko\/(\d{8})/i);
		if(!v) return;   // return if no string match
		v = parseInt(v[1]);
	}

	if (v < 20030624) {  // versions less than June 24, 2003 were earlier Netscape browsers
		px = parseInt(over.style.left);
		py = parseInt(over.style.top);
		pw = o3_width;
		ph = (o3_aboveheight ? parseInt(o3_aboveheight) : over.offsetHeight);
		selEl = (olIe4) ? o3_frame.document.all.tags("SELECT") : o3_frame.document.getElementsByTagName("SELECT");
		for (var i=0; i<selEl.length; i++) {
			if(!olIe4 && selEl[i].size < 2) continue;  // Not IE and SELECT size is 1 or not specified
			sx = pageLocation(selEl[i],'Left');
			sy = pageLocation(selEl[i],'Top');
			sw = selEl[i].offsetWidth;
			sh = selEl[i].offsetHeight;
			if((px+pw) < sx || px > (sx+sw) || (py+ph) < sy || py > (sy+sh)) continue;
			selEl[i].isHidden = 1;
			selEl[i].style.visibility = 'hidden';
		}
	}
}

// Shows previously hidden SELECT Boxes
function showSelectBox() {
	if(olNs4 || olOp || olIe55) return;
	var selEl, v;

	if(olIe4) v = 0;

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

		v = navigator.userAgent.match(/Gecko\/(\d{8})/i);
		if(!v) return; 
		v = parseInt(v[1]);
	}

	if(v < 20030624) {
		selEl = (olIe4) ? o3_frame.document.all.tags("SELECT") : o3_frame.document.getElementsByTagName("SELECT");
		for (var i=0; i<selEl.length; i++) {
			if(typeof selEl[i].isHidden !=  'undefined' && selEl[i].isHidden) {
				selEl[i].isHidden = 0;
				selEl[i].style.visibility = 'visible';
			}
		}
	}
}

// function gets the total offset properties of an element
// this same function occurs in overlib_mark.js.
function pageLocation(o,t){
	var x = 0

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

		if (ar[k]==SHADOWX) { eval(pf+'shadowx='+ar[++k]); return k; }
		if (ar[k]==SHADOWY) { eval(pf+'shadowy='+ar[++k]); return k; }
	}
	
	return -1;
}


// Function for MOUSEOUT/MOUSEOFF feature with shadow
function shadow_cursorOff() {
	var left= parseInt(over.style.left);
	var top=parseInt(over.style.top);
	var right=left+(o3_shadow ? o3_width : over.offsetWidth);
	var bottom=top+(o3_shadow ? o3_aboveheight : over.offsetHeight);
	
	if (o3_x < left || o3_x > right || o3_y < top || o3_y > bottom) return true;
	return false;
}

// Pre-hide processing to clean-up.
function checkShadowPreHide() {
	if (o3_shadow && o3_shadowopacity) cleanUpShadowEffects();
	if (o3_shadow && (olIe4 && isMac) ) over.style.pixelWidth=over.style.pixelHeight = 0;
}


// Funciton that creates the actual shadow
function generateShadow(content) {
	var wd, ht, X = 0, Y = 0, zIdx = 0, txt, dpObj, puObj, bS= '', aPos, posStr=new Array();

	if (!o3_shadow || (o3_shadowx == 0 && o3_shadowy == 0)) return;

	X = Math.abs(o3_shadowx);

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

	} else if (o3_shadowx < 0) {
		if (o3_shadowy > 0) {
		  posStr[0]=' left:0; top:'+Y+'px';
		  posStr[1]=' left:'+X+'px; top:0';
		} else if (o3_shadowy < 0) {
		  posStr[0]=' left:0; top:0';
		  posStr[1]=' left:'+X+'px; top:'+Y+'px';
		}
	}
	
	txt = (olNs4) ? '<div id="backdrop"></div>' : ((olIe55&&olHideForm) ? backDropSource(wd+X,ht+Y,zIdx++) : '') + '<div id="backdrop" style="position: absolute;'+posStr[0]+'; width: '+wd+'px; height: '+ht+'px; z-index: ' + (zIdx++) + '; ';

	if (o3_shadowimage) {
		bS='background-image: url('+o3_shadowimage+');';
		if (olNs4) bkSet=1;
	} else { 
		bS='background-color: '+o3_shadowcolor +';';
		if (olNs4) bkSet=2;
	}

	if (olNs4) {
		txt += '<div id="PUContent">'+content+'</div>';
	} else {
		txt += bS+'"></div><div id="PUContent" style="position: absolute;'+posStr[1]+'; width: '+ wd+'px; z-index: '+(zIdx++)+';">'+content+'</div>';
	}
	
	layerWrite(txt);

	if (olNs4 && bkSet) {
		dpObj = over.document.layers['backdrop'];
		if (typeof dpObj == 'undefined') return;  // if shadow layer not found, then content layer won't be either
		
		puObj = over.document.layers['PUContent'];
		wd = puObj.clip.width;

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


		aPos = posStr[1].split(';');
		puObj.left = parseInt(aPos[0].split(':')[1]);
		puObj.top = parseInt(aPos[1].split(':')[1]);
		puObj.zIndex = 1;
		
	} else {
		puObj = (olIe4 ? o3_frame.document.all['PUContent'] : o3_frame.document.getElementById('PUContent'));
		dpObj = (olIe4 ? o3_frame.document.all['backdrop'] : o3_frame.document.getElementById('backdrop'));
		ht = puObj.offsetHeight;
		dpObj.style.height = ht + 'px';
		
		if (o3_shadowopacity) {
			var op = o3_shadowopacity;
			op = (op <= 100 ? op : 100);
			
			setBrowserOpacity(op,dpObj);
		}
	} 

	// Set popup's new width and height values here so they are available in placeLayer()

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

	if (olNs4 || olOp) return;
	var dpObj=(olIe4 ? o3_frame.document.all['backdrop'] : o3_frame.document.getElementById('backdrop'));
	cleanUpBrowserOpacity(dpObj);
}

// multi browser opacity support
function setBrowserOpacity(op,lyr){
	if (olNs4||!op) return;  // if Ns4.x or opacity not given return;
	lyr=(lyr) ? lyr : over;
	if (olIe4&&typeof lyr.filters != 'undefined') {
		lyr.style.filter='Alpha(Opacity='+op+')';
		lyr.filters.alpha.enabled=true;
	} else {
		var sOp=(typeof(lyr.style.MozOpacity)!='undefined') ? 'MozOpacity' : (typeof(lyr.style.KhtmlOpacity)!='undefined' ? 'KhtmlOpacity' : (typeof(lyr.style.opacity)!='undefined' ? 'opacity' : '')); 
		if (sOp) eval('lyr.style.'+sOp+'=op/100');
	}
}

// multi-browser Opacity cleanup
function cleanUpBrowserOpacity(lyr) {
	if (olNs4) return;
	lyr=(lyr) ? lyr : over;
	if (olIe4&&(typeof lyr.filters != 'undefined'&&lyr.filters.alpha.enabled)) {
		lyr.style.filter='Alpha(Opacity=100)';
		lyr.filters.alpha.enabled=false;
	} else {
		var sOp=(typeof(lyr.style.MozOpacity)!='undefined') ? 'MozOpacity' : (typeof(lyr.style.KhtmlOpacity)!='undefined' ? 'KhtmlOpacity' : (typeof(lyr.style.opacity)!='undefined' ? 'opacity' : '')); 
		if (sOp) eval('lyr.style.'+sOp+'=1.0');
	}
}

// This routine is needed only for Ns4.x to allow use of popups with dropshadows and CSSCLASS at the same time on a page
function shadowAdjust() {
	if (!olNs4) return;
	var fac = ol_shadowadjust;
	if (olNs4) {
		document.write('<style type="text/css">\n<!--\n');
		document.write('#backdrop, #PUContent {position: absolute; left: '+fac*o3_shadowx+'px; top: '+fac*o3_shadowy+'px; }\n');
		document.write('-->\n<' + '\/style>');
	}
}

////////
// PLUGIN REGISTRATIONS
////////
var before = (typeof rmrkPreface!='undefined' ? rmrkPreface : null);

registerRunTimeFunction(setShadowVariables);
registerCmdLineFunction(parseShadowExtras);
registerHook("cursorOff",shadow_cursorOff,FREPLACE);
registerHook("hideObject",checkShadowPreHide,FBEFORE);
registerHook("createPopup",generateShadow,FAFTER,before);
if (olInfo.meets(4.10)) registerNoParameterCommands('shadow');

if (olNs4) shadowAdjust();  // write style rules for proper support of Ns4.x
}

applications/htmlroot/snmptraps/include/classes/class.common.php  view on Meta::CPAN

	   $this->site[] = '   </DIV>';
	}
	
	/**
	* Delete not used fields in the frontend, when unknown-traps was selected
	*
	* @params string $action 
	*
	* @author Michael Luebben <michael_luebben@web.de>
	*/
	function showTrapFields($action,$trap,$rowColor,$styleLine) {
       if ($_REQUEST['severity'] != "UNKNOWN") {
          if ($action == "field") {
             global $languageXML;
             $this->site[] = '      <TH CLASS="status">'.$languageXML['LANG']['MAIN']['TRAPTABLEHEADER']['CATEGORY'].'</TH>';
             $this->site[] = '      <TH CLASS="status">'.$languageXML['LANG']['MAIN']['TRAPTABLEHEADER']['SEVERITY'].'</TH>';
          }
	      elseif ($action == "entry") {
	         $this->site[] = '      <TD CLASS="'.$rowColor.'"><P '.$styleLine.'>'.$trap['category'].'</P></TD>';
	         $this->site[] = '      <TD CLASS="'.status.$trap['severity'].'" ALIGN="center"><P '.$styleLine.'>'.$trap['severity'].'</P></TD>'; 
	      }
	   } 
    }
	
    /**
	* Read Traps from Database and create Buttons for pages with limited trap entrys
	*
	* @author Jörg Linge
	* @author Michael Luebben <michael_luebben@web.de>
	*/

applications/htmlroot/snmptraps/include/classes/class.common.php  view on Meta::CPAN

	* @param string $traps
	*
	* @author Michael Luebben <michael_luebben@web.de>
	*/
	function createTrapPage($traps) {
	   global $configINI;
	   // Check if a trap mark as read
	   if(isset($traps)){
	      foreach($traps as $trap) {
             if ($trap['trapread'] == "1" or $trap['trapread'] == "2"){
                $styleLine = "style='text-decoration: line-through;'";
             } else {
                $styleLine = '';
             }
             // Set first row color
             if(!isset($rowColor)) {
			    $rowColor = "statusOdd";  
			 }
			 // Save the Trap-Message and delete " from Trap-Output
			 $trap['orgFormatline'] = str_replace('"',"",$trap['formatline']);
			 $arrIllegalCharJavabox = explode(",",$configINI['global']['illegalCharJavabox']);
			 foreach ($arrIllegalCharJavabox as $illegalChar) {
			    $trap['orgFormatline'] = str_replace($illegalChar,"",$trap['orgFormatline']);
			 }
			 
			 // Cut Trap-Message if that set in the Configurationfile
			 if($configINI['global']['cutTrapMessage'] != "") {
			    if(strlen($trap['formatline']) > $configINI['global']['cutTrapMessage']) {
			       $trap['formatline'] = substr($trap['formatline'],0,$configINI['global']['cutTrapMessage']).'.....';
				} 
			 }
             // Print trap
             $this->showTrap($trap,$rowColor,$styleLine);
             // Change color from row
			 if ($rowIndex == "0") {
                $rowColor = "statusOdd";
                $rowIndex = "1";
             } else {
                $rowColor = "statusEven";
                $rowIndex = "0";
             }
	      }
	   }   

applications/htmlroot/snmptraps/include/classes/class.frontend.php  view on Meta::CPAN

	*
	* @author Michael Luebben <michael_luebben@web.de>
    */
	function openSite() {
		$this->site[] = '<HTML>';
		$this->site[] = '<HEAD>';
		$this->site[] = '<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8"/>';
		$this->site[] = '<TITLE>'.$this->configINI['internal']['title'].' '.$this->configINI['internal']['version'].'</TITLE>';
		$this->site[] = '<SCRIPT TYPE="text/javascript" SRC="./include/js/nagtrap.js"></SCRIPT>';
		$this->site[] = '<SCRIPT TYPE="text/javascript" SRC="./include/js/overlib.js"></SCRIPT>';
		$this->site[] = '<LINK HREF="'.$this->configINI['nagios']['prefix'].'/include/css/nagtrap.css" REL="stylesheet" TYPE="text/css">';
		$this->site[] = '<LINK HREF="'.$this->configINI['nagios']['prefix'].'/include/css/status.css" REL="stylesheet" TYPE="text/css">';
		$this->site[] = '<LINK HREF="'.$this->configINI['nagios']['prefix'].'/include/css/showlog.css" REL="stylesheet" TYPE="text/css">';
		$this->site[] = '<LINK HREF="'.$this->configINI['nagios']['prefix'].'/include/css/common.css" REL="stylesheet" TYPE="text/css">';
		$this->site[] = '</HEAD>';
		$this->site[] = '<BODY CLASS="status">';
	}
	
	/**
	* Closed a Web-Site in the Array site[]
	*
	* @author Michael Luebben <michael_luebben@web.de>
    */
	function closeSite() {

applications/htmlroot/snmptraps/include/classes/class.frontend.php  view on Meta::CPAN

	   $infoBox .= $formatline;
	   $infoBox .= '\', CAPTION, \'Trap-Message\', VAUTO);" onmouseout="return nd();" ';
	   return($infoBox);
	}
	
    /**
	* Show traps
	*
	* @author Michael Luebben <michael_luebben@web.de>
	*/ 
	function showTrap($trap,$rowColor,$styleLine) {
	   global $configINI, $languageXML, $MAIN;
       $this->site[] = '   <TR>';

  	   /**
	   * @author Alex Peeters [alex.peeters@citap.be]
       */
       if ($MAIN->checkAction() == "1") {
   	      // Checkbox
	      $this->site[] = '      <TD CLASS="'.$rowColor.'"><INPUT TYPE="checkbox" NAME="trapIDs[]" VALUE="'.$trap['id'].'" '.$_GET['sel'].'>';
	      // Mark a trap
	      $this->site[] = '         <A HREF="./index.php?action=mark&amp;trapID='.$trap['id'].'&amp;severity='.$_REQUEST['severity'].'&amp;category='.rawurlencode($_REQUEST['category']).'&amp;hostname='.$_REQUEST['hostname'].'&amp;trapOID='.$_REQUEST['t...
	      // Delete a trap
	      $this->site[] = '         <A HREF="./index.php?action=delete&amp;trapID='.$trap['id'].'&amp;severity='.$_REQUEST['severity'].'&amp;category='.rawurlencode($_REQUEST['category']).'&amp;hostname='.$_REQUEST['hostname'].'&amp;trapOID='.$_REQUEST[...
	      $this->site[] = '      </TD>';
       }

	   // Select host
	   $this->site[] = '      <TD CLASS="'.$rowColor.'"><P '.$styleLine.'><A HREF="./index.php?severity='.$_REQUEST['severity'].'&amp;category='.rawurlencode($_REQUEST['category']).'&amp;hostname='.$trap['hostname'].'&amp;FQDN=T">'.$trap['hostname'].'</...
	   // Select trapOID
	   $this->site[] = '      <TD CLASS="'.$rowColor.'"><P '.$styleLine.'><A HREF="./index.php?severity='.$_REQUEST['severity'].'&amp;category='.rawurlencode($_REQUEST['category']).'&amp;hostname='.$trap['hostname'].'&amp;trapOID='.$trap['trapoid'].'&am...
	   $this->site[] = '      <TD CLASS="'.$rowColor.'"><P '.$styleLine.'>'.$trap['traptime'].'</P></TD>';
	   common::showTrapFields("entry",$trap,$rowColor,$styleLine);
	   $this->site[] = '      <TD CLASS="'.$rowColor.'"><P '.$styleLine.' '.$this->javaInfoBox($trap['orgFormatline']).'CLASS="formatline">'.htmlentities($trap['formatline']).'</P></TD>';
	   $this->site[] = '   </TR>';
	}
	
	// ======================= Contructor and functions for the footer of the frontend ====================== 
	
	/**
	* Constructor for the main
	*
	* @author Michael Luebben <michael_luebben@web.de>
	*/

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

	parseTokens('ol_', overlib_pagedefaults.arguments);
}


////////
// OVERLIB MAIN FUNCTION
////////

// This function decides what it is we want to display and how we want it done.
function olMain() {
	var layerhtml, styleType;
 	runHook("olMain", FBEFORE);
 	
	if (o3_background!="" || o3_fullhtml) {
		// Use background instead of box.
		layerhtml = runHook('ol_content_background', FALTERNATE, o3_css, o3_text, o3_background, o3_fullhtml);
	} else {
		// They want a popup box.
		styleType = (pms[o3_css-1-pmStart] == "cssoff" || pms[o3_css-1-pmStart] == "cssclass");

		// Prepare popup background
		if (o3_fgbackground != "") o3_fgbackground = "background=\""+o3_fgbackground+"\"";
		if (o3_bgbackground != "") o3_bgbackground = (styleType ? "background=\""+o3_bgbackground+"\"" : o3_bgbackground);

		// Prepare popup colors
		if (o3_fgcolor != "") o3_fgcolor = (styleType ? "bgcolor=\""+o3_fgcolor+"\"" : o3_fgcolor);
		if (o3_bgcolor != "") o3_bgcolor = (styleType ? "bgcolor=\""+o3_bgcolor+"\"" : o3_bgcolor);

		// Prepare popup height
		if (o3_height > 0) o3_height = (styleType ? "height=\""+o3_height+"\"" : o3_height);
		else o3_height = '';

		// Decide which kinda box.
		if (o3_cap=="") {
			// Plain
			layerhtml = runHook('ol_content_simple', FALTERNATE, o3_css, o3_text);
		} else {
			// With caption
			if (o3_sticky) {
				// Show close text

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


	set_background(picture);
	return txt;
}

// Loads a picture into the div.
function set_background(pic) {
	if (pic == "") {
		if (olNs4) {
			over.background.src = null; 
		} else if (over.style) {
			over.style.backgroundImage = "none";
		}
	} else {
		if (olNs4) {
			over.background.src = pic;
		} else if (over.style) {
			over.style.width=o3_width + 'px';
			over.style.backgroundImage = "url("+pic+")";
		}
	}
}

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

// Displays the popup

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

	runHook("disp", FAFTER);

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

// Creates the actual popup structure
function createPopup(lyrContent){
	runHook("createPopup", FBEFORE);
	
	if (o3_wrap) {
		var wd,ww,theObj = (olNs4 ? over : over.style);
		theObj.top = theObj.left = ((olIe4&&!olOp) ? 0 : -10000) + (!olNs4 ? 'px' : 0);
		layerWrite(lyrContent);
		wd = (olNs4 ? over.clip.width : over.offsetWidth);
		if (wd > (ww=windowWidth())) {
			lyrContent=lyrContent.replace(/\&nbsp;/g, ' ');
			o3_width=ww;
			o3_wrap=0;
		} 
	}

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

		}
		
		over.appendChild(domfrag);
	}
}

// Make an object visible
function showObject(obj) {
	runHook("showObject", FBEFORE);

	var theObj=(olNs4 ? obj : obj.style);
	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 = '';

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

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

	runHook("hideObject", FAFTER);
}

// Move a layer
function repositionTo(obj, xL, yL) {
	var theObj=(olNs4 ? obj : obj.style);
	theObj.left = xL + (!olNs4 ? 'px' : 0);
	theObj.top = yL + (!olNs4 ? 'px' : 0);
}

// Check position of cursor relative to overDiv DIVision; mouseOut function
function cursorOff() {
	var left = parseInt(over.style.left);
	var top = parseInt(over.style.top);
	var right = left + (over.offsetWidth >= parseInt(o3_width) ? over.offsetWidth : parseInt(o3_width));
	var bottom = top + (over.offsetHeight >= o3_aboveheight ? over.offsetHeight : o3_aboveheight);

	if (o3_x < left || o3_x > right || o3_y < top || o3_y > bottom) return true;

	return false;
}


////////

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

//    endWrap true(if end tag) or false if start tag
//    fontSizeStr - font size string such as '1' or '10px'
//    whichString is being wrapped -- 'text', 'caption', or 'close'
function wrapStr(endWrap,fontSizeStr,whichString) {
	var fontStr, fontColor, isClose=((whichString=='close') ? 1 : 0), hasDims=/[%\-a-z]+$/.test(fontSizeStr);
	fontSizeStr = (olNs4) ? (!hasDims ? fontSizeStr : '1') : fontSizeStr;
	if (endWrap) return (hasDims&&!olNs4) ? (isClose ? '</span>' : '</div>') : '</font>';
	else {
		fontStr='o3_'+whichString+'font';
		fontColor='o3_'+((whichString=='caption')? 'cap' : whichString)+'color';
		return (hasDims&&!olNs4) ? (isClose ? '<span style="font-family: '+quoteMultiNameFonts(eval(fontStr))+'; color: '+eval(fontColor)+'; font-size: '+fontSizeStr+';">' : '<div style="font-family: '+quoteMultiNameFonts(eval(fontStr))+'; color: '+eval(fo...
	}
}

// Quotes Multi word font names; needed for CSS Standards adherence in font-family
function quoteMultiNameFonts(theFont) {
	var v, pM=theFont.split(',');
	for (var i=0; i<pM.length; i++) {
		v=pM[i];
		v=v.replace(/^\s+/,'').replace(/\s+$/,'');
		if(/\s/.test(v) && !/['"]/.test(v)) {

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

		} else {
			var body = (olIe4 ? frm.document.all.tags('BODY')[0] : frm.document.getElementsByTagName("BODY")[0]);
			if (olIe4&&!document.getElementById) {
				body.insertAdjacentHTML("beforeEnd",'<div id="'+id+'"></div>');
				divContainer=layerReference(id);
			} else {
				divContainer = frm.document.createElement("DIV");
				divContainer.id = id;
				body.appendChild(divContainer);
			}
			objRef = divContainer.style;
		}

		with (objRef) {
			position = 'absolute';
			visibility = 'hidden';
			top = left = -10000 + (!olNs4) ? 'px' : 0;
			zIndex = zValue;
		}
	}

applications/tools/resources/CalendarPopup-combined-compact.js  view on Meta::CPAN

function getDateFromFormat(val,format){val=val+"";format=format+"";var i_val=0;var i_format=0;var c="";var token="";var token2="";var x,y;var now=new Date();var year=now.getYear();var month=now.getMonth()+1;var date=1;var hh=now.getHours();var mm=now...
function parseDate(val){var preferEuro=(arguments.length==2)?arguments[1]:false;generalFormats=new Array('y-M-d','MMM d, y','MMM d,y','y-MMM-d','d-MMM-y','MMM d');monthFirst=new Array('M/d/y','M-d-y','M.d.y','MMM-d','M/d','M-d');dateFirst =new Array(...

/* SOURCE FILE: PopupWindow.js */
function PopupWindow_getXYPosition(anchorname){var coordinates;if(this.type == "WINDOW"){coordinates = getAnchorWindowPosition(anchorname);}else{coordinates = getAnchorPosition(anchorname);}this.x = coordinates.x;this.y = coordinates.y;}
function PopupWindow_setSize(width,height){this.width = width;this.height = height;}
function PopupWindow_populate(contents){this.contents = contents;this.populated = false;}
function PopupWindow_setUrl(url){this.url = url;}
function PopupWindow_setWindowProperties(props){this.windowProperties = props;}
function PopupWindow_refresh(){if(this.divName != null){if(this.use_gebi){document.getElementById(this.divName).innerHTML = this.contents;}else if(this.use_css){document.all[this.divName].innerHTML = this.contents;}else if(this.use_layers){var d = do...
function PopupWindow_showPopup(anchorname){this.getXYPosition(anchorname);this.x += this.offsetX;this.y += this.offsetY;if(!this.populated &&(this.contents != "")){this.populated = true;this.refresh();}if(this.divName != null){if(this.use_gebi){docum...
function PopupWindow_hidePopup(){if(this.divName != null){if(this.use_gebi){document.getElementById(this.divName).style.visibility = "hidden";}else if(this.use_css){document.all[this.divName].style.visibility = "hidden";}else if(this.use_layers){docu...
function PopupWindow_isClicked(e){if(this.divName != null){if(this.use_layers){var clickX = e.pageX;var clickY = e.pageY;var t = document.layers[this.divName];if((clickX > t.left) &&(clickX < t.left+t.clip.width) &&(clickY > t.top) &&(clickY < t.top+...
function PopupWindow_hideIfNotClicked(e){if(this.autoHideEnabled && !this.isClicked(e)){this.hidePopup();}}
function PopupWindow_autoHide(){this.autoHideEnabled = true;}
function PopupWindow_hidePopupWindows(e){for(var i=0;i<popupWindowObjects.length;i++){if(popupWindowObjects[i] != null){var p = popupWindowObjects[i];p.hideIfNotClicked(e);}}}
function PopupWindow_attachListener(){if(document.layers){document.captureEvents(Event.MOUSEUP);}window.popupWindowOldEventListener = document.onmouseup;if(window.popupWindowOldEventListener != null){document.onmouseup = new Function("window.popupWin...
function PopupWindow(){if(!window.popupWindowIndex){window.popupWindowIndex = 0;}if(!window.popupWindowObjects){window.popupWindowObjects = new Array();}if(!window.listenerAttached){window.listenerAttached = true;PopupWindow_attachListener();}this.in...


/* SOURCE FILE: CalendarPopup.js */

applications/tools/resources/CalendarPopup-combined.js  view on Meta::CPAN

	this.getXYPosition(anchorname);
	this.x += this.offsetX;
	this.y += this.offsetY;
	if (!this.populated && (this.contents != "")) {
		this.populated = true;
		this.refresh();
		}
	if (this.divName != null) {
		// Show the DIV object
		if (this.use_gebi) {
			document.getElementById(this.divName).style.left = this.x + "px";
			document.getElementById(this.divName).style.top = this.y + "px";
			document.getElementById(this.divName).style.visibility = "visible";
			}
		else if (this.use_css) {
			document.all[this.divName].style.left = this.x;
			document.all[this.divName].style.top = this.y;
			document.all[this.divName].style.visibility = "visible";
			}
		else if (this.use_layers) {
			document.layers[this.divName].left = this.x;
			document.layers[this.divName].top = this.y;
			document.layers[this.divName].visibility = "visible";
			}
		}
	else {
		if (this.popupWindow == null || this.popupWindow.closed) {
			// If the popup window will go off-screen, move it so it doesn't

applications/tools/resources/CalendarPopup-combined.js  view on Meta::CPAN

			var avoidAboutBlank = window.opera || ( document.layers && !navigator.mimeTypes['*'] ) || navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled );
			this.popupWindow = window.open(avoidAboutBlank?"":"about:blank","window_"+anchorname,this.windowProperties+",width="+this.width+",height="+this.height+",screenX="+this.x+",left="+this.x+",screenY="+this.y+",top="+this.y+"");
			}
		this.refresh();
		}
	}
// Hide the popup
function PopupWindow_hidePopup() {
	if (this.divName != null) {
		if (this.use_gebi) {
			document.getElementById(this.divName).style.visibility = "hidden";
			}
		else if (this.use_css) {
			document.all[this.divName].style.visibility = "hidden";
			}
		else if (this.use_layers) {
			document.layers[this.divName].visibility = "hidden";
			}
		}
	else {
		if (this.popupWindow && !this.popupWindow.closed) {
			this.popupWindow.close();
			this.popupWindow = null;
			}

applications/tools/resources/CalendarPopup-combined.js  view on Meta::CPAN

	this.setSize = PopupWindow_setSize;
	this.isClicked = PopupWindow_isClicked;
	this.autoHide = PopupWindow_autoHide;
	this.hideIfNotClicked = PopupWindow_hideIfNotClicked;
	}

/* SOURCE FILE: CalendarPopup.js */

// HISTORY
// ------------------------------------------------------------------
// Feb 7, 2005: Fixed a CSS styles to use px unit
// March 29, 2004: Added check in select() method for the form field
//      being disabled. If it is, just return and don't do anything.
// March 24, 2004: Fixed bug - when month name and abbreviations were
//      changed, date format still used original values.
// January 26, 2004: Added support for drop-down month and year
//      navigation (Thanks to Chris Reid for the idea)
// September 22, 2003: Fixed a minor problem in YEAR calendar with
//      CSS prefix.
// August 19, 2003: Renamed the function to get styles, and made it
//      work correctly without an object reference
// August 18, 2003: Changed showYearNavigation and 
//      showYearNavigationInput to optionally take an argument of
//      true or false
// July 31, 2003: Added text input option for year navigation.
//      Added a per-calendar CSS prefix option to optionally use 
//      different styles for different calendars.
// July 29, 2003: Fixed bug causing the Today link to be clickable 
//      even though today falls in a disabled date range.
//      Changed formatting to use pure CSS, allowing greater control
//      over look-and-feel options.
// June 11, 2003: Fixed bug causing the Today link to be unselectable
//      under certain cases when some days of week are disabled
// March 14, 2003: Added ability to disable individual dates or date
//      ranges, display as light gray and strike-through
// March 14, 2003: Removed dependency on graypixel.gif and instead 
///     use table border coloring

applications/tools/resources/CalendarPopup-combined.js  view on Meta::CPAN


// When the 'year' select is displayed, set the number of years back from the 
// current year to start listing years. Default is 2.
// This is also used for year drop-down, to decide how many years +/- to display
cal.setYearSelectStartOffset(2);

// Text for the word "Today" appearing on the calendar
cal.setTodayText("Today");

// The calendar uses CSS classes for formatting. If you want your calendar to
// have unique styles, you can set the prefix that will be added to all the
// classes in the output.
// For example, normal output may have this:
//     <SPAN CLASS="cpTodayTextDisabled">Today<SPAN>
// But if you set the prefix like this:
cal.setCssPrefix("Test");
// The output will then look like:
//     <SPAN CLASS="TestcpTodayTextDisabled">Today<SPAN>
// And you can define that style somewhere in your page.

// When using Year navigation, you can make the year be an input box, so
// the user can manually change it and jump to any year
cal.showYearNavigationInput();

// Set the calendar offset to be different than the default. By default it
// will appear just below and to the right of the anchorname. So if you have
// a text box where the date will go and and anchor immediately after the
// text box, the calendar will display immediately under the text box.
cal.offsetX = 20;

applications/tools/resources/CalendarPopup-combined.js  view on Meta::CPAN

   <A NAME="test" ID="test"> </A>

3) There must be at least a space between <A> </A> for IE5.5 to see the 
   anchor tag correctly. Do not do <A></A> with no space.

4) When a CalendarPopup object is created, a handler for 'onmouseup' is
   attached to any event handler you may have already defined. Do NOT define
   an event handler for 'onmouseup' after you define a CalendarPopup object 
   or the autoHide() will not work correctly.
   
5) The calendar popup display uses style sheets to make it look nice.

*/ 

// CONSTRUCTOR for the CalendarPopup Object
function CalendarPopup() {
	var c;
	if (arguments.length>0) {
		c = new PopupWindow(arguments[0]);
		}
	else {

applications/tools/resources/CalendarPopup-combined.js  view on Meta::CPAN

		time = getDateFromFormat(inputobj.value,format);
		}
	if (selectedDate!=null || inputobj.value!="") {
		if (time==0) { this.currentDate=null; }
		else { this.currentDate=new Date(time); }
		}
	window.CP_dateFormat = format;
	this.showCalendar(linkname);
	}
	
// Get style block needed to display the calendar correctly
function getCalendarStyles() {
	var result = "";
	var p = "";
	if (this!=null && typeof(this.cssPrefix)!="undefined" && this.cssPrefix!=null && this.cssPrefix!="") { p=this.cssPrefix; }
	result += "<STYLE>\n";
	result += "."+p+"cpYearNavigation,."+p+"cpMonthNavigation { background-color:#C0C0C0; text-align:center; vertical-align:center; text-decoration:none; color:#000000; font-weight:bold; }\n";
	result += "."+p+"cpDayColumnHeader, ."+p+"cpYearNavigation,."+p+"cpMonthNavigation,."+p+"cpCurrentMonthDate,."+p+"cpCurrentMonthDateDisabled,."+p+"cpOtherMonthDate,."+p+"cpOtherMonthDateDisabled,."+p+"cpCurrentDate,."+p+"cpCurrentDateDisabled,."+p+"...
	result += "TD."+p+"cpDayColumnHeader { text-align:right; border:solid thin #C0C0C0;border-width:0px 0px 1px 0px; }\n";
	result += "."+p+"cpCurrentMonthDate, ."+p+"cpOtherMonthDate, ."+p+"cpCurrentDate  { text-align:right; text-decoration:none; }\n";
	result += "."+p+"cpCurrentMonthDateDisabled, ."+p+"cpOtherMonthDateDisabled, ."+p+"cpCurrentDateDisabled { color:#D0D0D0; text-align:right; text-decoration:line-through; }\n";

applications/tools/templates/HEADER.html  view on Meta::CPAN

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
  <title>Application Monitoring @ CITAP</title>
  <META HTTP-EQUIV="Expires" CONTENT="Wed, 10 Dec 2003 00:00:01 GMT">
  <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
  <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
  <META HTTP-EQUIV="Refresh" CONTENT="3600">
  <link rel="stylesheet" type="text/css" href="/asnmtap/asnmtap-results.css">
  
  </head>
<BODY >
  <TABLE WIDTH="100%"><TR>
	<td class="HeaderTitel">Application Monitoring</td><td width="180" class="HeaderSubTitel">Config</td>
  </TR></TABLE>
  <HR>
<br>
<table WIDTH="100%" border=0><tr><td class="DataDirectory">

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

  } else {
    $htmlEntityString = $string;
  }

  return ($htmlEntityString);
}

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

sub print_header {
  my ($HTML, $pagedir, $pageset, $htmlTitle, $subTitle, $refresh, $onload, $openPngImage, $headScript, $sessionID, $stylesheet) = @_;

  my ($pageDir, $environment) = split (/\//, $pagedir, 2);
  $environment = 'P' unless (defined $environment);

  my $sessionIdOrCookie = ( defined $sessionID ) ? "&amp;CGISESSID=$sessionID" : "&amp;CGICOOKIE=1";
  my $reloadOrToggle    = ( $subTitle =~ /^(?:Full View|Condenced View|Minimal Condenced View)$/ ) ? "<A HREF=\"#\" onClick=\"togglePageDirCookie('pagedir_id_${pageDir}_${environment}', '$HTTPSURL/nav/$pagedir')\">" : "<A HREF=\"#\" onClick=\"reloadP...
  my $selectEnvironment = (( $pagedir ne '<NIHIL>' and $pageset ne '<NIHIL>' ) ? '<form action="" name="environment"><select name="environment" size="1" onChange="loadEnvironmentPageDirCookie(\'' .$pageDir. '\', this.options[this.selectedIndex].value...

  my $showToggle   = ($pagedir ne '<NIHIL>') ? $reloadOrToggle : "<A HREF=\"$HTTPSURL/cgi-bin/$pageset/index.pl?pagedir=$pagedir&amp;pageset=$pageset&amp;debug=F$sessionIdOrCookie\">";
  $showToggle     .= "<IMG SRC=\"$IMAGESURL/toggle.gif\" title=\"Toggle\" alt=\"Toggle\" WIDTH=\"32\" HEIGHT=\"27\" BORDER=0></A>";
  my $showReport   = ($pagedir ne '<NIHIL>') ? "<A HREF=\"$HTTPSURL/nav/$pagedir/reports-$pageset.html\"><IMG SRC=\"$IMAGESURL/report.gif\" title=\"Report\" alt=\"Report\" WIDTH=\"32\" HEIGHT=\"27\" BORDER=0></A>" : '';
  my $showOnDemand = ($pagedir ne '<NIHIL>') ? "<A HREF=\"$HTTPSURL/cgi-bin/runCmdOnDemand.pl?pagedir=$pagedir&amp;pageset=$pageset$sessionIdOrCookie\"><IMG SRC=\"$IMAGESURL/ondemand.gif\" title=\"On demand\" alt=\"On demand\" WIDTH=\"32\" HEIGHT=\"2...
  my $showData     = ($pagedir ne '<NIHIL>') ? "<A HREF=\"$HTTPSURL/cgi-bin/getArchivedReport.pl?pagedir=$pagedir&amp;pageset=$pageset$sessionIdOrCookie\"><IMG SRC=\"$IMAGESURL/data.gif\" title=\"Report Archive\" alt=\"Report Archive\" WIDTH=\"32\" H...
  my $showAwstats  = ($AWSTATSENABLED) ? "<A HREF=\"/awstats/awstats.pl\" target=\"_blank\"><IMG SRC=\"$IMAGESURL/awstats.gif\" title=\"Awstats\" alt=\"Awstats\" WIDTH=\"32\" HEIGHT=\"27\" BORDER=0></A>" : '';
  my $showInfo     = "<A HREF=\"$HTTPSURL/cgi-bin/info.pl?pagedir=$pagedir&amp;pageset=$pageset$sessionIdOrCookie\"><IMG SRC=\"$IMAGESURL/info.gif\" title=\"Info\" alt=\"Info\" WIDTH=\"32\" HEIGHT=\"27\" BORDER=0></A>";

  $stylesheet = "asnmtap.css" unless ( defined $stylesheet );

  my $metaRefresh = ( $onload =~ /^\QONLOAD="startRefresh();\E/ ) ? "" : "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"$refresh\">";
  my ($showRefresh, $showSound, $showJSFX) = ('', '', '');
  my (undef, $cMonth, $cDay) = Today();

  if ( ( $pagedir =~ /^(?:index|test)$/ ) and ( ( $cMonth == 01 and $cDay == 01 ) || ( $cMonth == 02 and $cDay == 14 ) || ( $cMonth == 12 and $cDay > 21 and $cDay < 29 ) || ( $cMonth == 12 and $cDay == 31 ) ) ) {
    $showJSFX .= "<script language=\"JavaScript\" SRC=\"$HTTPSURL/JSFX_Layer.js\"></script>\n<script language=\"JavaScript\" SRC=\"$HTTPSURL/JSFX_Browser.js\"></script>\n<script language=\"JavaScript\" SRC=\"$HTTPSURL/";

    if ( $cMonth == 01 and $cDay == 01 ) {
      $showJSFX .= 'JSFX_Fireworks2.js';

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

  print $HTML <<EndOfHtml;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title>${ENVIRONMENT{$environment}}: $APPLICATION @ $BUSINESS</title>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
  <META HTTP-EQUIV="Expires" CONTENT="Wed, 10 Dec 2003 00:00:01 GMT">
  <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
  <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
  $metaRefresh
  <link rel="stylesheet" type="text/css" href="$HTTPSURL/$stylesheet">
  $headScript
  <script language="JavaScript1.2" type="text/javascript">
    var pagedir_prefix = new Array();
    pagedir_prefix[0] = "";
    pagedir_prefix[1] = "-cv";
    pagedir_prefix[2] = "-mcv";

    function getPageDirCookie( name ) {
      var prefix = name + '=';
      var ca = document.cookie.split( ';' );

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;
  <script language="JavaScript1.2" type="text/javascript">

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

        print REPORTS <<EndOfHtml;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">  
<html>
<head>
  <title>${ENVIRONMENT{$environment}}: $APPLICATION @ $BUSINESS</title>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
  <META HTTP-EQUIV="Expires" CONTENT="Wed, 10 Dec 2003 00:00:01 GMT">
  <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
  <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
  <META HTTP-EQUIV="Refresh" CONTENT="$refresh">
  <link rel="stylesheet" type="text/css" href="$HTTPSURL/asnmtap.css">
  <script language="JavaScript1.2" type="text/javascript">
    var pagedir_prefix = new Array();
    pagedir_prefix[0] = "";
    pagedir_prefix[1] = "-cv";
    pagedir_prefix[2] = "-mcv";

    function getPageDirCookie( name ) {
      var prefix = name + '=';
      var ca = document.cookie.split( ';' );

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


Call with ASNMTAP::Asnmtap::Plugins::NPTest->testCmd("./check_disk ...."). This returns a NPTest object
which you can then run $object->return_code or $object->output against.

Testing of results would be done in your test script, not in this module.

=item C<checkCmd(...)>

This function is obsolete. Use C<testCmd()> instead.

This function attempts to encompass the majority of test styles used
in testing Nagios Plugins. As each plug-in is a separate command, the
typical tests we wish to perform are against the exit status of the
command and the output (if any) it generated. Simplifying these tests
into a single function call, makes the test harness easier to read and
maintain and allows additional functionality (such as debugging) to be
provided without additional effort on the part of the test harness
developer.

It is possible to enable debugging via the environment variable
C<NPTEST_DEBUG>. If this environment variable exists and its value in PERL's

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

  {
    $testStatus += skip( "Missing ${command} - tests skipped", 1 );
  }

  return $testStatus;
}

sub getTestParameter
{
  my( $param, $envvar, $default, $brief, $scoped );
  my $new_style;
  if (scalar @_ <= 3) {
	($param, $brief, $default) = @_;
	$envvar = $param;
	$new_style = 1;
  } else {
	( $param, $envvar, $default, $brief, $scoped ) = @_;
	$new_style = 0;
  }

  # Apply default values for optional arguments
  $scoped = ( defined( $scoped ) && $scoped );

  my $testharness = basename( (caller(0))[1], ".t" ); # used for scoping

  if ( defined( $envvar ) &&  exists( $ENV{$envvar} ) && $ENV{$envvar} )
  {
    return $ENV{$envvar};
  }

  my $cachedValue = SearchCache( $param, $testharness );
  if ( defined( $cachedValue ) )
  {
    # This save required to convert to new style because the key required is
    # changing to the environment variable
    if ($new_style == 0) {
      SetCacheParameter( $envvar, undef, $cachedValue );
    }
    return $cachedValue;
  }

  my $defaultValid      = ( defined( $default ) && $default );
  my $autoAcceptDefault = ( exists( $ENV{'NPTEST_ACCEPTDEFAULT'} ) && $ENV{'NPTEST_ACCEPTDEFAULT'} );

  if ( $autoAcceptDefault && $defaultValid )
  {

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

              } else {
                foreach my $testcase_name (keys %{$xml->{testClass}->{testcase}}) {
                  print "xml->{testClass}->{testcase}->{$testcase_name}->{time}<->\n", $xml->{testClass}->{testcase}->{$testcase_name}->{time}, "\n" if ($debug == 2);
                  $objectPlugins->appendPerformanceData ( "'".$testcase_name.$testresultName."'=". $xml->{testClass}->{testcase}->{$testcase_name}->{time} .'s;;;;' );
                }
              }

              $objectPlugins->pluginValue ( stateValue => $ERRORS{CRITICAL} );

              unless (defined $httpdumpMessage) {
                $httpdumpMessage  = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<HTML><HEAD><TITLE>jUnit XML::Parser \@ $APPLICATION</TITLE></HEAD><BODY><HR><H1 style=\"margin: 0px 0px 5px; font: 125% verdana,arial,helvetica\"...
              } else {
                $httpdumpMessage .= "<BR>";
              }

              $httpdumpMessage .= "<H2 style=\"margin-top: 1em; margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica\">Server : $xml->{server}</H2>";
              $httpdumpMessage .= "<H2 style=\"margin-top: 1em; margin-bottom: 0.5em; font: bold 90% verdana,arial,helvetica\">Summary: $xml->{name} ($xml->{version}) - $xml->{Test_success}</H2>";

              $httpdumpMessage .= "<TABLE WIDTH=\"100%\"><TR style=\"font: normal 68% bold verdana,arial,helvetica; text-align:left; background:#a6caf0;\"><TH>Tests</TH><TH>Failures</TH><TH>Errors</TH><TH>Time</TH></TR>";
              $httpdumpMessage .= "<TR style=\"background:#eeeee0; font: normal 68% bold verdana,arial,helvetica; color:purple;\"><TD>$xml->{testClass}->{tests}</TD><TD>$xml->{testClass}->{failures}</TD><TD>$xml->{testClass}->{errors}</TD><TD>$xml->{...
              $httpdumpMessage .= "</TD></TR></TABLE>\n";
              $httpdumpMessage .= "<table width=\"100%\" border=\"0\"><tr><td style=\"font: verdana,arial,helvetica; text-align: justify;\">Note: <i>failures</i> are anticipated and checked for with assertions while <i>errors</i> are unanticipated.</...

              $httpdumpMessage .= "<H3 style=\"margin-bottom: 0.5em; font: bold 90% verdana,arial,helvetica\">Testcase: $xml->{testClass}->{name} ($xml->{testClass}->{package})</H3>\n";
              $httpdumpMessage .= "<TABLE WIDTH=\"100%\"><TR style=\"font: normal 68% bold verdana,arial,helvetica; text-align:left; background:#a6caf0;\"><TH>Name</TH><TH>Status</TH><TH>Type</TH><TH>Time</TH></TR>\n";

              if (defined $xml->{testClass}->{testcase}->{name}) {
                my ($status, $type, $message, $content);

                if (defined $xml->{testClass}->{testcase}->{error}) {
                  $status  = 'ERROR';
                  $type    = $xml->{testClass}->{testcase}->{error}->{type};
                  $message = $xml->{testClass}->{testcase}->{error}->{message};
                  $content = $xml->{testClass}->{testcase}->{error}->{content};
                } elsif (defined $xml->{testClass}->{testcase}->{failure}) {
                  $status  = 'FAILURE';
                  $type    = $xml->{testClass}->{testcase}->{failure}->{type};
                  $message = $xml->{testClass}->{testcase}->{failure}->{message};
                } else {
                  $status  = 'OK';
                  $type    = $message = '';
                }

                $httpdumpMessage .= "<TR style=\"background:#eeeee0; font: normal 68% bold verdana,arial,helvetica; color:red;\"><TD>$xml->{testClass}->{testcase}->{name}</TD><TD>$status</TD><TD>$type</TD><TD>$xml->{testClass}->{testcase}->{time}</TD...

                if ($status ne 'OK') {
                  $httpdumpMessage .= "<TR style=\"background:#eeeee0; font: normal 68% bold verdana,arial,helvetica; color:red;\"><TD></TD><TD colspan=\"3\"><PRE>$message</PRE></TD></TR>\n";
                  $httpdumpMessage .= "<TR style=\"background:#eeeee0; font: normal 68% bold verdana,arial,helvetica; color:red;\"><TD></TD><TD colspan=\"3\"><PRE>$content</PRE></TD></TR>\n" if (defined $content);
                }
              } else {
                foreach my $testcase_name (keys %{$xml->{testClass}->{testcase}}) {
                  my ($status, $type, $message, $content);

                  if (defined $xml->{testClass}->{testcase}->{$testcase_name}->{error}) {
                    $status  = 'ERROR';
                    $type    = $xml->{testClass}->{testcase}->{$testcase_name}->{error}->{type};
                    $message = $xml->{testClass}->{testcase}->{$testcase_name}->{error}->{message};
                    $content = $xml->{testClass}->{testcase}->{$testcase_name}->{error}->{content};
                  } elsif (defined $xml->{testClass}->{testcase}->{$testcase_name}->{failure}) {
                    $status  = 'FAILURE';
                    $type    = $xml->{testClass}->{testcase}->{$testcase_name}->{failure}->{type};
                    $message = $xml->{testClass}->{testcase}->{$testcase_name}->{failure}->{message};
                  } else {
                    $status  = 'OK';
                    $type    = $message = '';
                  }

                  $httpdumpMessage .= "<TR style=\"background:#eeeee0; font: normal 68% bold verdana,arial,helvetica; color:red;\"><TD>$testcase_name</TD><TD>$status</TD><TD>$type</TD><TD>$xml->{testClass}->{testcase}->{$testcase_name}->{time}</TD></...

                  if ($status ne 'OK') {
                    $httpdumpMessage .= "<TR style=\"background:#eeeee0; font: normal 68% bold verdana,arial,helvetica; color:red;\"><TD></TD><TD colspan=\"3\"><PRE>$message</PRE></TD></TR>\n";
                    $httpdumpMessage .= "<TR style=\"background:#eeeee0; font: normal 68% bold verdana,arial,helvetica; color:red;\"><TD></TD><TD colspan=\"3\"><PRE>$content</PRE></TD></TR>\n" if (defined $content);
                  }
                }
              }

              $httpdumpMessage .= "</TABLE>\n";
            }

            $alertError .= (defined $testresultSuffix) ? $testresultSuffix : $xml->{name};
            $alertError .= '+';
          }

plugins/nagios/templates/check_xml-monitoring-1.2.pl  view on Meta::CPAN


my ($returnCode, $xml) = extract_XML ( asnmtapInherited => \$objectNagios, filenameXML => $filename, headerXML => HEADER, footerXML => FOOTER, validateDTD => $validateDTD, filenameDTD => "dtd/Monitoring-$schema.dtd" );
$objectNagios->exit (3) if ( $returnCode );

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

my $currentTimeslot = timelocal ((localtime)[0,1,2,3,4,5]);
my %environment = ( P => 'PROD', S => 'SIM', A => 'ACC', T => 'TEST', D => 'DEV', L => 'LOCAL' );

if ($xml->{Monitoring}{Schema}{Value} eq $schema) {
  $debugfileMessage  = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<HTML><HEAD><TITLE>$message \@ $APPLICATION</TITLE><style type=\"text/css\">\n.statusOdd { font-family: arial,serif; font-size: 10pt; background-color: #DBDBDB...
  my $firstResults = 1;

  if ( ref $xml->{Monitoring}{Results} eq 'ARRAY' ) {
    foreach my $results (@{$xml->{Monitoring}{Results}}) {
      processAllResult ( \$debugfileMessage, $firstResults, \$results, $reverse, $debug );
      $firstResults = 0;
    }
  } else {
    processAllResult ( \$debugfileMessage, $firstResults, \$xml->{Monitoring}{Results}, $reverse, $debug );
  }

plugins/nagios/templates/check_xml-monitoring-1.2.pl  view on Meta::CPAN

$objectNagios->exit (3);

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

sub processAllResult {
  my ($debugfileMessage, $firstResults, $result, $reverse, $debug) = @_;

  my $match = ( $$result->{Details}{Host} eq $hostname and $$result->{Details}{Service} eq $service ) ? 1 : 0;

  if (! $firstResults or ($match and $$result->{Details}{Environment} =~ /^$environment{$environment}$/i)) {
    $$debugfileMessage .= "\n<TABLE WIDTH=\"100%\"><TR><TD>\n<H3 style=\"margin-bottom: 0.5em; font: bold 90% verdana,arial,helvetica\">Environment: $environmentText</H3></TD></TR></TABLE>\n";
    $$debugfileMessage .= "\n<TABLE WIDTH=\"100%\">";

    validateResultOrSubResult ( $firstResults, \$$result, 0, $reverse, $debug );

    if ( defined $$result->{SubResults} ) {
      if ( ref $$result->{SubResults} eq 'ARRAY' ) {
        foreach my $subResults (@{$$result->{SubResults}}) {
          validateResultOrSubResult ( $firstResults, \$subResults, 1, $reverse, $debug );
        }
      } else {
        validateResultOrSubResult ( $firstResults, \$$result->{SubResults}, 1, $reverse, $debug );
      }
    }

    $debugfileMessage .= "</TABLE>\n";
    $debugfileMessage .= "<P style=\"font: normal 68% verdana,arial,helvetica;\" ALIGN=\"left\">Generated on: " .scalar(localtime()). "</P>\n</BODY>\n</HTML>";
  } else {
    my $tError = 'Content Error:';
    $tError .= ' - Host: '. $$result->{Details}{Host} ." ne $hostname" if ($$result->{Details}{Host} ne $hostname);
    $tError .= ' - Service: '. $$result->{Details}{Service} ." ne $service" if ($$result->{Details}{Service} ne $service);
    $tError .= ' - Environment: ' .$$result->{Details}{Environment} ." ne ". $environment{$environment} if ($$result->{Details}{Environment} !~ /^$environment{$environment}$/i);
    $objectNagios->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, error => $tError, result => undef }, $TYPE{APPEND} );
  }
}

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

plugins/nagios/templates/check_xml-monitoring-1.2.pl  view on Meta::CPAN

    $objectNagios->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, error => "Date or Time into XML from filename '$filename' are wrong: $checkDate $checkTime", result => undef }, $TYPE{APPEND} );
  } elsif ( $checkEpochtime != $xmlEpochtime ) {
    $objectNagios->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, error => "Epochtime difference from Date and Time into XML from filename '$filename' are wrong: $checkEpochtime != $xmlEpochtime ($checkDate $checkTime)", result => undef }, $TYPE{AP...
  } elsif ( $currentTimeslot - $checkEpochtime > $resultOutOfDate ) {
    $objectNagios->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, error => "Result into XML from filename '$filename' are out of date: $checkDate $checkTime", result => undef }, $TYPE{APPEND} );
  } else {
    my ($errorDetail, $errorStack);
    $debugfileMessage .= "<TR><TD COLSPAN=\"7\">&nbsp;</TD></TR>\n";

    if ( $subResult == 0 ) {
      $debugfileMessage .= "\n<TR style=\"font: normal verdana,arial,helvetica; background:#c9c9c9;\"><TD colspan=\"7\" ALIGN=\"CENTER\" CLASS=\"status". $STATE{$$result->{$label}{Status}}. "\"><B>". $STATE{$$result->{$label}{Status}}. "</B></TD></TR...
      $debugfileMessage .= "<TR><TD COLSPAN=\"7\">&nbsp;</TD></TR>\n";
      $debugfileMessage .= "\n<TR style=\"font: normal bold verdana,arial,helvetica; background:#0eeeee;\"><TD colspan=\"7\">Result: " .$$result->{$label}{Service}. "</TD></TR>";

      if ( $firstResults ) {
        $objectNagios->pluginValues ( { stateError => $STATE{$$result->{$label}{Status}}, alert => $$result->{$label}{StatusMessage}, result => $$result->{$label}{content} }, $TYPE{APPEND} );
      } else {
        $objectNagios->pluginValues ( { alert => $$result->{$label}{StatusMessage}, result => $$result->{$label}{content} }, $TYPE{APPEND} );
      }

      $errorDetail = $$result->{ErrorDetail} if ( $$result->{ErrorDetail} );
	    $errorStack  = $$result->{ErrorStack} if ( $$result->{ErrorStack} );
    } else {
      $debugfileMessage .= "\n<TR style=\"font: normal bold verdana,arial,helvetica; background:#0eeeee;\"><TD colspan=\"7\">Sub Result: " .$$result->{$label}{Service}. "</TD></TR>";
      $objectNagios->pluginValues( { alert => $$result->{$label}{Service} ." " . $STATE{$$result->{$label}{Status}} }, $TYPE{APPEND} );
      $errorDetail = $$result->{SubErrorDetail} if ( $$result->{SubErrorDetail} );
	    $errorStack  = $$result->{SubErrorStack} if ( $$result->{SubErrorStack} );
    }

    $debugfileMessage .= "<TR style=\"font: normal bold 68% verdana,arial,helvetica; text-align:left; background:#a6a6a6;\"><TH>Host</TH><TH>Service</TH><TH>Environment</TH><TH>Date</TH><TH>Time</TH><TH>StatusMessage</TH><TH>Status</TH></TR>\n";
    $debugfileMessage .= "<TR style=\"font: normal 68% verdana,arial,helvetica; background:#e1e1ef;\"><TD>" .$$result->{$label}{Host}. "</TD><TD>" .$$result->{$label}{Service}. "</TD><TD>" .$$result->{$label}{Environment} ."</TD><TD>" .$$result->{$la...
    $debugfileMessage .= "<TR style=\"font: normal 68% verdana,arial,helvetica; background:#eeeee0;\"><TD valign=\"top\">Error Detail</TD><TD colspan=\"6\"><PRE>$errorDetail</PRE></TD></TR>\n" if ( $errorDetail );
    $debugfileMessage .= "<TR style=\"font: normal 68% verdana,arial,helvetica; background:#e1e1ef;\"><TD valign=\"top\">Error Stack</TD><TD colspan=\"6\"><PRE>$errorStack</PRE></TD></TR>\n" if ( $errorStack );
    $debugfileMessage .= "<TR><TD COLSPAN=\"7\">&nbsp;</TD></TR>\n" if ( $subResult == 0 );

    $objectNagios->appendPerformanceData( "'" . $$result->{$label}{Service} ."'=" . $$result->{$label}{Status} . ';1;2;0;2' );
    $objectNagios->appendPerformanceData( $$result->{$label}{PerfData} ) if ( $$result->{$label}{PerfData} );
  }
}

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

__END__

plugins/snmptt/check_SNMPTT_oracle.pl  view on Meta::CPAN

  $objectPlugins->pluginValue ( message => $message );
}

my $tMessage  = 'SNMP Trap Translator Database';

my $tHostname = ( defined $hostname ? "and hostname='$hostname'" : '' );
$hostname = 'undef' unless ( defined $hostname ) ;

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

my $debugfileMessage = "\n<HTML><HEAD><TITLE>$tMessage \@ $APPLICATION</TITLE><style type=\"text/css\">\n.statusOdd { font-family: arial,serif; font-size: 10pt; background-color: #DBDBDB; }\n.statusEven { font-family: arial,serif; font-size: 10pt; ba...
$debugfileMessage .= "<TD>,&nbsp;&nbsp;Hostname:</TD><TD><B>$hostname</B></TD>" unless ($hostname eq 'undef');
$debugfileMessage .= "<TD>,&nbsp;&nbsp;Community:</TD><TD><B>$community</B></TD><TD>,&nbsp;&nbsp;Environment:</TD><TD><B>$environmentText</B></TD></TR></TABLE><BR>";

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

my ($dbh, $sth, $sthDO, $rv, $query);
$rv = 1;

$dbh = DBI->connect ( "dbi:mysql:$serverDb:$serverHost:$serverPort", "$serverUser", "$serverPass" ) or $rv = errorTrapDBI ( \$objectPlugins,  'Sorry, cannot connect to the database' );

plugins/snmptt/check_SNMPTT_oracle.pl  view on Meta::CPAN

  my $tEpochtime = $currentTimeslot;
  my $tSeverity  = $ERRORS{OK};

  $query = "SELECT SQL_NO_CACHE id, eventname, eventid, trapoid, enterprise, agentip, severity, uptime, traptime, formatline, system_running_SNMPTT, trapread FROM `$serverTact` WHERE community='$community' $tHostname and category='$category' order by...
  $sth = $dbh->prepare($query) or $rv = errorTrapDBI ( \$objectPlugins,  'Cannot dbh->prepare: '. $query ) if ( $rv );
  $rv  = $sth->execute() or $rv = errorTrapDBI ( \$objectPlugins,  'Cannot sth->execute: '. $query ) if ( $rv );
  $sth->bind_columns( \$id, \$eventname, \$eventid, \$trapoid, \$enterprise, \$agentip, \$severity, \$uptime, \$traptime, \$formatline, \$system_running_SNMPTT, \$trapread ) or $rv = errorTrapDBI ( \$objectPlugins,  'Cannot sth->bind_columns: '. $que...

  if ( $rv ) {
    my (%tableOracle, %tableOracleDetail, %tableOracleUniqueProblemSeverity);
    $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR><TD>\n<H2 style=\"margin-bottom: 0.5em; font: bold 90% verdana,arial,helvetica\">BOLD: are the new traps</H2></TD></TR></TABLE>";

    if ( $sth->rows() ) {
      my ( $uniqueProblem, $codeBefore, $codeAfter );

      while( $sth->fetch() ) {
        my ($_eventname, $detailLine, $uniqueTrap, $trapHostOwnerName) = ($eventname, $formatline, '(NULL)', $tEpochtime);
        my (undef, $variables, ) = split ( /: /, $formatline, 2 );

        for ( $eventname ) {
          /^oraEM4Alert$/ && do {    # oraEM4Alert trap: $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13

plugins/snmptt/check_SNMPTT_oracle.pl  view on Meta::CPAN

        }

        $tableOracleDetail{$trapHostOwnerName}{$_eventname}{$uniqueTrap}{$id} = "<TD>$codeBefore$detailLine$codeAfter</TD><TD WIDTH=\"180\">$codeBefore$traptime$codeAfter</TD><TD WIDTH=\"80\" ALIGN=\"CENTER\" CLASS=\"status$severity\">$codeBefore$sev...
      }
    }

    # delete records regarding the solved problems
    my $backgroundColor = '#eeeee0';

    if ( $debug >= 2 ) {
      $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR><TD>\n<H3 style=\"margin-bottom: 0.5em; font: bold 90% verdana,arial,helvetica\">List regarding the records to delete for the solved problems</H3></TD></TR></TABLE>\n";
      $debugfileMessage .= "<TABLE WIDTH=\"100%\" cellspacing=\"1\" cellpadding=\"1\"><TR style=\"font: normal bold 68% verdana,arial,helvetica; text-align:left; background:#a6a6a6;\"><TH>Unique Trap Key</TH><TH WIDTH=\"80\" ALIGN=\"CENTER\">Severity...
    }

    foreach my $uniqueProblem (sort keys %tableOracleUniqueProblemSeverity) {
      $backgroundColor = ($backgroundColor eq '#eeeee0') ? '#e1e1ef' : '#eeeee0';
      my $severity = $tableOracleUniqueProblemSeverity{$uniqueProblem};

      if ( $debug >= 2 ) {
        print "\n             + $uniqueProblem => $severity\n";
        $debugfileMessage .= "<TABLE WIDTH=\"100%\" cellspacing=\"1\" cellpadding=\"1\"><TR style=\"font: normal 68% verdana,arial,helvetica; background:$backgroundColor;\"><TD>$uniqueProblem</TD><TD WIDTH=\"80\" ALIGN=\"CENTER\" CLASS=\"status$sever...
      }

      if ( $ERRORS{$severity} == 0 ) {
        if ( ! $onDemand ) {
          my ( $trapHostOwnerName, $eventname, $uniqueTrap, $sqlDELETE ) = split ( /\|/, $uniqueProblem, 3 );

          if ( $uniqueTrap eq 'oraServerStart' ) {
            $sqlDELETE = "DELETE FROM `$serverTact` WHERE uniqueProblem regexp '^$trapHostOwnerName\\\\|' and trapread='2'";
          } else {
            $sqlDELETE = "DELETE FROM `$serverTact` WHERE uniqueProblem='$uniqueProblem' and trapread='2'";
          }

          if ( $debug >= 2 ) {
            print "             - $sqlDELETE\n";
            $debugfileMessage .= "<TABLE WIDTH=\"100%\" cellspacing=\"1\" cellpadding=\"1\"><TR style=\"font: normal 68% verdana,arial,helvetica; background:$backgroundColor;\"><TD colspan=\"2\">$sqlDELETE</TD></TR></TABLE>"; 
          } else {
            $dbh->do( $sqlDELETE ) or $rv = errorTrapDBI ( \$objectPlugins,  'Cannot dbh->do: '. $sqlDELETE );
          }
        }
      } else {
        $tSeverity  = ( $tSeverity > $ERRORS{$severity} ) ? $tSeverity : $ERRORS{$severity};
      }
    }

    $debugfileMessage .= "<BR>" if ( $debug >= 2 );

    # print Oracle Status
    $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR style=\"font: normal verdana,arial,helvetica;\"><TD ALIGN=\"CENTER\" CLASS=\"status". $STATE{$tSeverity}. "\"><B>". $STATE{$tSeverity}. "</B></TD></TR></TABLE><BR>";

    # print table Hosts Summary
    $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR><TD>\n<H3 style=\"margin-bottom: 0.5em; font: bold 90% verdana,arial,helvetica\">Hosts Summary</H3></TD></TR></TABLE>";
    my $prev_trapServerName;
    my $_severity = $ERRORS{OK};

    foreach my $_trapServerName (sort keys %tableOracleDetail) {
      if ( defined $prev_trapServerName and $prev_trapServerName ne $_trapServerName ) {
        $debugfileMessage .= "<TABLE WIDTH=\"100%\" cellspacing=\"1\" cellpadding=\"1\"><TR style=\"font: normal 68% verdana,arial,helvetica; background:#c9c9c9;\"><TH>&nbsp;</TH><TD WIDTH=\"80\" ALIGN=\"CENTER\" CLASS=\"status". $STATE{$_severity}. ...
        $_severity = $ERRORS{OK};
      }

      $prev_trapServerName = $_trapServerName;

      $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR style=\"font: normal bold 79% verdana,arial,helvetica; text-align:left; background:#a6caf0;\"><TH>Host: $_trapServerName</TH></TR></TABLE>\n";
      my $eventname = $tableOracleDetail{$_trapServerName};

      foreach my $_eventname (sort { $b cmp $a } keys %$eventname) {
         $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR style=\"font: normal bold 68% verdana,arial,helvetica; text-align:left; background:#a6a6a6;\"><TH>Eventname: $_eventname</TH><TH WIDTH=\"180\">Traptime</TH><TH WIDTH=\"80\" ALIGN=\"CENTER\">Sev...
         my $uniqueTrap = $eventname->{$_eventname};
         my $backgroundColor = '#eeeee0';

         foreach my $_uniqueTrap (sort { $b cmp $a } keys %$uniqueTrap) {
           my $detail = $uniqueTrap->{$_uniqueTrap};
           $backgroundColor = ($backgroundColor eq '#eeeee0') ? '#e1e1ef' : '#eeeee0';

           foreach my $line (sort { $b cmp $a } keys %$detail) {
             my $uniqueProblem = "$_trapServerName|$_eventname|$_uniqueTrap";
             my $severity = $tableOracleUniqueProblemSeverity { $uniqueProblem };
             $_severity = ( $_severity > $ERRORS{$severity} ) ? $_severity : $ERRORS{$severity};
             $debugfileMessage .= "<TR style=\"font: normal 68% verdana,arial,helvetica; background:$backgroundColor;\">". $detail->{$line} ."</TR>" if ( $severity ne 'OK' or $debug >= 2 );
             $debugfileMessage .= "<TR style=\"font: normal 68% verdana,arial,helvetica; background:$backgroundColor;\"><TD colspan=\"2\">$uniqueProblem</TD><TD WIDTH=\"80\" ALIGN=\"CENTER\" CLASS=\"status$severity\">$severity</TD></TR>" if ( $debug ...
             last;
           }
         }

        $debugfileMessage .= "</TABLE>\n";
      }
    }

    $debugfileMessage .= "<TABLE WIDTH=\"100%\" cellspacing=\"1\" cellpadding=\"1\"><TR style=\"font: normal 68% verdana,arial,helvetica; background:#c9c9c9;\"><TH>&nbsp;</TH><TD WIDTH=\"80\" ALIGN=\"CENTER\" CLASS=\"status". $STATE{$_severity}. "\">...
    $debugfileMessage .= "<BR><HR><BR>";

    # print table Hosts Detail
    $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR><TD>\n<H3 style=\"margin-bottom: 0.5em; font: bold 90% verdana,arial,helvetica\">Hosts Detail</H3></TD></TR></TABLE>";

    foreach my $trapHostOwnerName (sort keys %tableOracleDetail) {
      $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR style=\"font: normal bold 79% verdana,arial,helvetica; text-align:left; background:#a6caf0;\"><TH>Host: $trapHostOwnerName</TH></TR></TABLE>\n";
      my $eventname = $tableOracleDetail{$trapHostOwnerName};

      foreach my $key (sort { $b cmp $a } keys %$eventname) {
        $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR style=\"font: normal bold 68% verdana,arial,helvetica; text-align:left; background:#a6a6a6;\"><TH>Eventname: $key</TH><TH WIDTH=\"180\">Traptime</TH><TH WIDTH=\"80\" ALIGN=\"CENTER\">Severity</T...
        my $uniqueTrap = $eventname->{$key};
        my $backgroundColor = '#eeeee0';

        foreach my $key (sort { $b cmp $a } keys %$uniqueTrap) {
          my $detail = $uniqueTrap->{$key};
          $backgroundColor = ($backgroundColor eq '#eeeee0') ? '#e1e1ef' : '#eeeee0';

          foreach my $key (sort { $b cmp $a } keys %$detail) {
            $debugfileMessage .= "<TR style=\"font: normal 68% verdana,arial,helvetica; background:$backgroundColor;\">". $detail->{$key} ."</TR>";
          }
        }

        $debugfileMessage .= "</TABLE>\n";
      }

      $debugfileMessage .= "<BR>\n";
    }

    my ($number, $tAlertFixed, $tAlertVariable);

plugins/snmptt/check_SNMPTT_oracle.pl  view on Meta::CPAN

    } else {
      $objectPlugins->pluginValues ( { stateError => $STATE{$tSeverity}, alert => 'No new problems available.' }, $TYPE{APPEND} );
    }

    $sth->finish() or $rv = errorTrapDBI ( \$objectPlugins,  'Cannot sth->finish: '. $query );
  } 

  $dbh->disconnect() or $rv = errorTrapDBI ( \$objectPlugins,  'The database $serverDb was unable to read your entry.' );
}

$debugfileMessage .= "<P style=\"font: normal 68% verdana,arial,helvetica;\" ALIGN=\"left\">Generated on: " .scalar(localtime()). "</P>\n</BODY>\n</HTML>";
$objectPlugins->write_debugfile ( \$debugfileMessage, 0 );

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

$objectPlugins->exit (7);

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

plugins/snmptt/check_SNMPTT_weblogic.pl  view on Meta::CPAN

  $objectPlugins->pluginValue ( message => $message );
}

my $tMessage  = 'SNMP Trap Translator Database';

my $tHostname = ( defined $hostname ? "and hostname='$hostname'" : '' );
$hostname = 'undef' unless ( defined $hostname ) ;

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

my $debugfileMessage = "\n<HTML><HEAD><TITLE>$tMessage \@ $APPLICATION</TITLE><style type=\"text/css\">\n.statusOdd { font-family: arial,serif; font-size: 10pt; background-color: #DBDBDB; }\n.statusEven { font-family: arial,serif; font-size: 10pt; ba...

if ( defined $agentLocation and defined $hosts ) {
  $debugfileMessage .= "<TD>,&nbsp;&nbsp;Agent Location:</TD><TD><B>$agentLocation</B></TD><TD>,&nbsp;&nbsp;Hosts:</TD><TD><B>$hosts</B></TD>";
}

$debugfileMessage .= "</TR></TABLE><BR>";

if ( defined $adminConsole ) {
  my (undef, undef, $tAdminConsole, undef) = split ( /\//, $adminConsole, 4 );

  use ASNMTAP::Asnmtap::Plugins::WebTransact;

  my @URLS = ();
  my $objectWebTransact = ASNMTAP::Asnmtap::Plugins::WebTransact->new ( \$objectPlugins, \@URLS );

  @URLS = (
    { Method => 'GET',  Url => $adminConsole, Qs_var => [], Qs_fixed => [], Exp => ["WebLogic Server Administration Console", "(?:Sign in to work with the WebLogic Server|Log in to work with the WebLogic Server domain)"], Exp_Fault => ">>>NIHIL<<<", ...
  );

  my $returnCode = $objectWebTransact->check ( { } );
  $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR><TD>\n<H2 style=\"margin-bottom: 0.5em; font: bold 90% verdana,arial,helvetica\">Admin Console: $adminConsole</H2></TD></TR></TABLE>";
  $debugfileMessage .= "<TABLE WIDTH=\"100%\" BORDER=\"1\"><TR style=\"font: normal verdana,arial,helvetica;\"><TD ALIGN=\"CENTER\" CLASS=\"status". $STATE{$returnCode}. "\"><B>". $STATE{$returnCode}. "</B></TD></TR></TABLE><BR>";
  $objectPlugins->appendPerformanceData ( "'Admin Console: Status'=$returnCode;1;2;0;2" );
  undef $objectWebTransact;
}

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

my ($dbh, $sth, $sthDO, $rv, $query);
$rv = 1;

$dbh = DBI->connect ( "dbi:mysql:$serverDb:$serverHost:$serverPort", "$serverUser", "$serverPass" ) or $rv = errorTrapDBI ( \$objectPlugins,  'Sorry, cannot connect to the database' );

plugins/snmptt/check_SNMPTT_weblogic.pl  view on Meta::CPAN

  my $tEpochtime = $currentTimeslot;
  my $tSeverity  = $ERRORS{OK};

  $query = "SELECT SQL_NO_CACHE id, eventname, eventid, trapoid, enterprise, agentip, severity, uptime, traptime, formatline, system_running_SNMPTT, trapread FROM `$serverTact` WHERE community='$community' $tHostname and category='$category' order by...
  $sth = $dbh->prepare($query) or $rv = errorTrapDBI ( \$objectPlugins,  'Cannot dbh->prepare: '. $query ) if ( $rv );
  $rv  = $sth->execute() or $rv = errorTrapDBI ( \$objectPlugins,  'Cannot sth->execute: '. $query ) if ( $rv );
  $sth->bind_columns( \$id, \$eventname, \$eventid, \$trapoid, \$enterprise, \$agentip, \$severity, \$uptime, \$traptime, \$formatline, \$system_running_SNMPTT, \$trapread ) or $rv = errorTrapDBI ( \$objectPlugins,  'Cannot sth->bind_columns: '. $que...

  if ( $rv ) {
    my (%tableVirtualServers, %tableVirtualServersDetail, %tableVirtualServersUniqueProblemSeverity);
    $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR><TD>\n<H2 style=\"margin-bottom: 0.5em; font: bold 90% verdana,arial,helvetica\">Domain: $domainname, BOLD: are the new traps</H2></TD></TR></TABLE>";

    if ( $sth->rows() ) {
      my ( $uniqueProblem, $codeBefore, $codeAfter );

      while( $sth->fetch() ) {
        my ($_eventname, $detailLine, $uniqueTrap, $trapServerName, $trapMonitorType, $trapMBeanName, $trapMBeanType, $trapAttributeName, $trapMachineName, $trapLogThreadId, $trapLogTransactionId, $trapLogUserId, $trapLogSubsystem, $trapLogMsgId, $tr...

        for ( $eventname ) {
          /^wlsLogNotification$/ && do {     # Server Log Notification: $2, $3, $4, $5, $6, $7, $8, $9, $10
            my (undef, $variables, ) = split ( /: /, $formatline, 2 );

plugins/snmptt/check_SNMPTT_weblogic.pl  view on Meta::CPAN

        }

        $tableVirtualServersDetail{$trapServerName}{$_eventname}{$uniqueTrap}{$id} = "<TD>$codeBefore$detailLine$codeAfter</TD><TD WIDTH=\"180\">$codeBefore$traptime$codeAfter</TD><TD WIDTH=\"80\" ALIGN=\"CENTER\" CLASS=\"status$severity\">$codeBefor...
      }
    }

    # delete records regarding the solved problems
    my $backgroundColor = '#eeeee0';

    if ( $debug >= 2 ) {
      $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR><TD>\n<H3 style=\"margin-bottom: 0.5em; font: bold 90% verdana,arial,helvetica\">List regarding the records to delete for the solved problems</H3></TD></TR></TABLE>\n";
      $debugfileMessage .= "<TABLE WIDTH=\"100%\" cellspacing=\"1\" cellpadding=\"1\"><TR style=\"font: normal bold 68% verdana,arial,helvetica; text-align:left; background:#a6a6a6;\"><TH>Unique Trap Key</TH><TH WIDTH=\"80\" ALIGN=\"CENTER\">Severity...
    }

    foreach my $uniqueProblem (sort keys %tableVirtualServersUniqueProblemSeverity) {
      $backgroundColor = ($backgroundColor eq '#eeeee0') ? '#e1e1ef' : '#eeeee0';
      my $severity = $tableVirtualServersUniqueProblemSeverity{$uniqueProblem};

      if ( $debug >= 2 ) {
        print "\n             + $uniqueProblem => $severity\n";
        $debugfileMessage .= "<TABLE WIDTH=\"100%\" cellspacing=\"1\" cellpadding=\"1\"><TR style=\"font: normal 68% verdana,arial,helvetica; background:$backgroundColor;\"><TD>$uniqueProblem</TD><TD WIDTH=\"80\" ALIGN=\"CENTER\" CLASS=\"status$sever...
      }

      if ( $ERRORS{$severity} == 0 ) {
        if ( ! $onDemand ) {
          my ( $trapServerName, $eventname, $uniqueTrap, $sqlDELETE ) = split ( /\|/, $uniqueProblem, 3 );

          if ( $uniqueTrap eq 'wlsServerStart' ) {
            $sqlDELETE = "DELETE FROM `$serverTact` WHERE uniqueProblem regexp '^$trapServerName\\\\|' and trapread='2'";
          } else {
            $sqlDELETE = "DELETE FROM `$serverTact` WHERE uniqueProblem='$uniqueProblem' and trapread='2'";
          }

          if ( $debug >= 2 ) {
            print "             - $sqlDELETE\n";
            $debugfileMessage .= "<TABLE WIDTH=\"100%\" cellspacing=\"1\" cellpadding=\"1\"><TR style=\"font: normal 68% verdana,arial,helvetica; background:$backgroundColor;\"><TD colspan=\"2\">$sqlDELETE</TD></TR></TABLE>"; 
          } else {
            $dbh->do( $sqlDELETE ) or $rv = errorTrapDBI ( \$objectPlugins,  'Cannot dbh->do: '. $sqlDELETE );
          }
        }
      } else {
        $tSeverity  = ( $tSeverity > $ERRORS{$severity} ) ? $tSeverity : $ERRORS{$severity};
      }
    }

    $debugfileMessage .= "<BR>" if ( $debug >= 2 );

    # print Domain Status
    $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR style=\"font: normal verdana,arial,helvetica;\"><TD ALIGN=\"CENTER\" CLASS=\"status". $STATE{$tSeverity}. "\"><B>". $STATE{$tSeverity}. "</B></TD></TR></TABLE><BR>";

    # print table Virtual Servers Summary
    $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR><TD>\n<H3 style=\"margin-bottom: 0.5em; font: bold 90% verdana,arial,helvetica\">Virtual Servers Summary</H3></TD></TR></TABLE>";
    my $prev_trapServerName;
    my $_severity = $ERRORS{OK};

    foreach my $_trapServerName (sort keys %tableVirtualServersDetail) {
      if ( defined $prev_trapServerName and $prev_trapServerName ne $_trapServerName ) {
        $debugfileMessage .= "<TABLE WIDTH=\"100%\" cellspacing=\"1\" cellpadding=\"1\"><TR style=\"font: normal 68% verdana,arial,helvetica; background:#c9c9c9;\"><TH>&nbsp;</TH><TD WIDTH=\"80\" ALIGN=\"CENTER\" CLASS=\"status". $STATE{$_severity}. ...
        $_severity = $ERRORS{OK};
      }

      $prev_trapServerName = $_trapServerName;

      $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR style=\"font: normal bold 79% verdana,arial,helvetica; text-align:left; background:#a6caf0;\"><TH>Virtual Server: $_trapServerName</TH></TR></TABLE>\n";
      my $eventname = $tableVirtualServersDetail{$_trapServerName};

      foreach my $_eventname (sort { $b cmp $a } keys %$eventname) {
         $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR style=\"font: normal bold 68% verdana,arial,helvetica; text-align:left; background:#a6a6a6;\"><TH>Eventname: $_eventname</TH><TH WIDTH=\"180\">Traptime</TH><TH WIDTH=\"80\" ALIGN=\"CENTER\">Sev...
         my $uniqueTrap = $eventname->{$_eventname};
         my $backgroundColor = '#eeeee0';

         foreach my $_uniqueTrap (sort { $b cmp $a } keys %$uniqueTrap) {
           my $detail = $uniqueTrap->{$_uniqueTrap};
           $backgroundColor = ($backgroundColor eq '#eeeee0') ? '#e1e1ef' : '#eeeee0';

           foreach my $line (sort { $b cmp $a } keys %$detail) {
             my $uniqueProblem = "$_trapServerName|$_eventname|$_uniqueTrap";
             my $severity = $tableVirtualServersUniqueProblemSeverity { $uniqueProblem };
             $_severity = ( $_severity > $ERRORS{$severity} ) ? $_severity : $ERRORS{$severity};
             $debugfileMessage .= "<TR style=\"font: normal 68% verdana,arial,helvetica; background:$backgroundColor;\">". $detail->{$line} ."</TR>" if ( $severity ne 'OK' or $debug >= 2 );
             $debugfileMessage .= "<TR style=\"font: normal 68% verdana,arial,helvetica; background:$backgroundColor;\"><TD colspan=\"2\">$uniqueProblem</TD><TD WIDTH=\"80\" ALIGN=\"CENTER\" CLASS=\"status$severity\">$severity</TD></TR>" if ( $debug ...
             last;
           }
         }

        $debugfileMessage .= "</TABLE>\n";
      }
    }

    $debugfileMessage .= "<TABLE WIDTH=\"100%\" cellspacing=\"1\" cellpadding=\"1\"><TR style=\"font: normal 68% verdana,arial,helvetica; background:#c9c9c9;\"><TH>&nbsp;</TH><TD WIDTH=\"80\" ALIGN=\"CENTER\" CLASS=\"status". $STATE{$_severity}. "\">...
    $debugfileMessage .= "<BR><HR><BR>";

    # print table Virtual Servers Detail
    $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR><TD>\n<H3 style=\"margin-bottom: 0.5em; font: bold 90% verdana,arial,helvetica\">Virtual Servers Detail</H3></TD></TR></TABLE>";

    foreach my $trapServerName (sort keys %tableVirtualServersDetail) {
      $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR style=\"font: normal bold 79% verdana,arial,helvetica; text-align:left; background:#a6caf0;\"><TH>Virtual Server: $trapServerName</TH></TR></TABLE>\n";
      my $eventname = $tableVirtualServersDetail{$trapServerName};

      foreach my $key (sort { $b cmp $a } keys %$eventname) {
        $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR style=\"font: normal bold 68% verdana,arial,helvetica; text-align:left; background:#a6a6a6;\"><TH>Eventname: $key</TH><TH WIDTH=\"180\">Traptime</TH><TH WIDTH=\"80\" ALIGN=\"CENTER\">Severity</T...
        my $uniqueTrap = $eventname->{$key};
        my $backgroundColor = '#eeeee0';

        foreach my $key (sort { $b cmp $a } keys %$uniqueTrap) {
          my $detail = $uniqueTrap->{$key};
          $backgroundColor = ($backgroundColor eq '#eeeee0') ? '#e1e1ef' : '#eeeee0';

          foreach my $key (sort { $b cmp $a } keys %$detail) {
            $debugfileMessage .= "<TR style=\"font: normal 68% verdana,arial,helvetica; background:$backgroundColor;\">". $detail->{$key} ."</TR>";
          }
        }

        $debugfileMessage .= "</TABLE>\n";
      }

      $debugfileMessage .= "<BR>\n";
    }

    my ($number, $tAlertFixed, $tAlertVariable);

plugins/snmptt/check_SNMPTT_weblogic.pl  view on Meta::CPAN

    } else {
      $objectPlugins->pluginValues ( { stateError => $STATE{$tSeverity}, alert => 'No new problems available.' }, $TYPE{APPEND} );
    }

    $sth->finish() or $rv = errorTrapDBI ( \$objectPlugins,  'Cannot sth->finish: '. $query );
  } 

  $dbh->disconnect() or $rv = errorTrapDBI ( \$objectPlugins,  'The database $serverDb was unable to read your entry.' );
}

$debugfileMessage .= "<P style=\"font: normal 68% verdana,arial,helvetica;\" ALIGN=\"left\">Generated on: " .scalar(localtime()). "</P>\n</BODY>\n</HTML>";
$objectPlugins->write_debugfile ( \$debugfileMessage, 0 );

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

$objectPlugins->exit (7);

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

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

  $query = "SELECT SQL_NO_CACHE id, eventname, eventid, trapoid, enterprise, agentip, severity, uptime, traptime, formatline, system_running_SNMPTT, trapread FROM `$serverTact` WHERE community='$community' $tHostname and category='$category' order by...
  $sth = $dbh->prepare($query) or $rv = errorTrapDBI ( \$objectPlugins, 'Cannot dbh->prepare: '. $query ) if ( $rv );
  $rv  = $sth->execute() or $rv = errorTrapDBI ( \$objectPlugins, 'Cannot sth->execute: '. $query ) if ( $rv );
  $sth->bind_columns( \$id, \$eventname, \$eventid, \$trapoid, \$enterprise, \$agentip, \$severity, \$uptime, \$traptime, \$formatline, \$system_running_SNMPTT, \$trapread ) or $rv = errorTrapDBI ( \$objectPlugins, 'Cannot sth->bind_columns: '. $quer...

  if ( $rv ) {
    my ($debugfileMessage, %tableVirtualServers, %tableVirtualServersDetail, %tableVirtualServersUniqueProblemSeverity);

    if ( $sth->rows() ) {
      my ( $uniqueProblem, $codeBefore, $codeAfter );
      $debugfileMessage  = "\n<HTML><HEAD><TITLE>$tMessage \@ $APPLICATION</TITLE><style type=\"text/css\">\n.statusOdd { font-family: arial,serif; font-size: 10pt; background-color: #DBDBDB; }\n.statusEven { font-family: arial,serif; font-size: 10pt...
      $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR><TD>\n<H2 style=\"margin-bottom: 0.5em; font: bold 90% verdana,arial,helvetica\">Domain: $domainname ($environmentText), BOLD: are the new traps</H2></TD></TR></TABLE>";

      while( $sth->fetch() ) {
        my ($_eventname, $detailLine, $uniqueTrap, $trapServerName, $trapMonitorType, $trapMBeanName, $trapMBeanType, $trapAttributeName) = ($eventname, $formatline, 'NULL', $tEpochtime);

        for ( $eventname ) {
          /^wlsLogNotification$/ && do {
            $uniqueTrap = 'wlsLogNotification';
		    last; };
          /^wlsServerStart$/ && do {
            $_eventname = 'wlsServerShutDown or wlsServerStart';

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

        }

        $tableVirtualServersDetail{$trapServerName}{$_eventname}{$uniqueTrap}{$id} = "<TD>$codeBefore$detailLine$codeAfter</TD><TD WIDTH=\"180\">$codeBefore$traptime$codeAfter</TD><TD WIDTH=\"80\" ALIGN=\"CENTER\" CLASS=\"status$severity\">$codeBefor...
      }
    }

    # delete records regarding the solved problems
    my $backgroundColor = '#eeeee0';

    if ( $debug >= 2 ) {
      $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR><TD>\n<H3 style=\"margin-bottom: 0.5em; font: bold 90% verdana,arial,helvetica\">List regarding the records to delete for the solved problems</H3></TD></TR></TABLE>\n";
      $debugfileMessage .= "<TABLE WIDTH=\"100%\" cellspacing=\"1\" cellpadding=\"1\"><TR style=\"font: normal bold 68% verdana,arial,helvetica; text-align:left; background:#a6a6a6;\"><TH>Unique Trap Key</TH><TH WIDTH=\"80\" ALIGN=\"CENTER\">Severity...
    }

    foreach my $uniqueProblem (sort keys %tableVirtualServersUniqueProblemSeverity) {
      $backgroundColor = ($backgroundColor eq '#eeeee0') ? '#e1e1ef' : '#eeeee0';
      my $severity = $tableVirtualServersUniqueProblemSeverity{$uniqueProblem};

      if ( $debug >= 2 ) {
        print "\n             + $uniqueProblem => $severity\n";
        $debugfileMessage .= "<TABLE WIDTH=\"100%\" cellspacing=\"1\" cellpadding=\"1\"><TR style=\"font: normal 68% verdana,arial,helvetica; background:$backgroundColor;\"><TD>$uniqueProblem</TD><TD WIDTH=\"80\" ALIGN=\"CENTER\" CLASS=\"status$sever...
      }

      if ( $ERRORS{$severity} == 0 ) {
        if ( ! $onDemand ) {
          my $sqlDELETE = "DELETE FROM `$serverTact` WHERE uniqueProblem='$uniqueProblem' and trapread='2'";

          if ( $debug >= 2 ) {
            print "             - $sqlDELETE\n";
            $debugfileMessage .= "<TABLE WIDTH=\"100%\" cellspacing=\"1\" cellpadding=\"1\"><TR style=\"font: normal 68% verdana,arial,helvetica; background:$backgroundColor;\"><TD colspan=\"2\">$sqlDELETE</TD></TR></TABLE>"; 
          } else {
            $dbh->do( $sqlDELETE ) or $rv = errorTrapDBI ( \$objectPlugins, 'Cannot dbh->do: '. $sqlDELETE );
          }
        }
      } else {
        $tSeverity  = ( $tSeverity > $ERRORS{$severity} ) ? $tSeverity : $ERRORS{$severity};
      }
    }

    $debugfileMessage .= "<BR>" if ( $debug >= 2 );

    # print Domain Status
    $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR style=\"font: normal verdana,arial,helvetica;\"><TD ALIGN=\"CENTER\" CLASS=\"status". $STATE{$tSeverity}. "\"><B>". $STATE{$tSeverity}. "</B></TD></TR></TABLE><BR>";

    # print table Virtual Servers Summary
    $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR><TD>\n<H3 style=\"margin-bottom: 0.5em; font: bold 90% verdana,arial,helvetica\">Virtual Servers Summary</H3></TD></TR></TABLE>";
    my $prev_trapServerName;
    my $_severity = $ERRORS{OK};

    foreach my $_trapServerName (sort keys %tableVirtualServersDetail) {
      if ( defined $prev_trapServerName and $prev_trapServerName ne $_trapServerName ) {
        $debugfileMessage .= "<TABLE WIDTH=\"100%\" cellspacing=\"1\" cellpadding=\"1\"><TR style=\"font: normal 68% verdana,arial,helvetica; background:#c9c9c9;\"><TH>&nbsp;</TH><TD WIDTH=\"80\" ALIGN=\"CENTER\" CLASS=\"status". $STATE{$_severity}. ...
        $_severity = $ERRORS{OK};
      }

      $prev_trapServerName = $_trapServerName;

      $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR style=\"font: normal bold 79% verdana,arial,helvetica; text-align:left; background:#a6caf0;\"><TH>Virtual Server: $_trapServerName</TH></TR></TABLE>\n";
      my $eventname = $tableVirtualServersDetail{$_trapServerName};

      foreach my $_eventname (sort { $b cmp $a } keys %$eventname) {
         $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR style=\"font: normal bold 68% verdana,arial,helvetica; text-align:left; background:#a6a6a6;\"><TH>Eventname: $_eventname</TH><TH WIDTH=\"180\">Traptime</TH><TH WIDTH=\"80\" ALIGN=\"CENTER\">Sev...
         my $uniqueTrap = $eventname->{$_eventname};
         my $backgroundColor = '#eeeee0';

         foreach my $_uniqueTrap (sort { $b cmp $a } keys %$uniqueTrap) {
           my $detail = $uniqueTrap->{$_uniqueTrap};
           $backgroundColor = ($backgroundColor eq '#eeeee0') ? '#e1e1ef' : '#eeeee0';

           foreach my $line (sort { $b cmp $a } keys %$detail) {
             my $uniqueProblem = "$_trapServerName|$_eventname|$_uniqueTrap";
             my $severity = $tableVirtualServersUniqueProblemSeverity { $uniqueProblem };
             $_severity = ( $_severity > $ERRORS{$severity} ) ? $_severity : $ERRORS{$severity};
             $debugfileMessage .= "<TR style=\"font: normal 68% verdana,arial,helvetica; background:$backgroundColor;\">". $detail->{$line} ."</TR>" if ( $severity ne 'OK' or $debug >= 2 );
             $debugfileMessage .= "<TR style=\"font: normal 68% verdana,arial,helvetica; background:$backgroundColor;\"><TD colspan=\"2\">$uniqueProblem</TD><TD WIDTH=\"80\" ALIGN=\"CENTER\" CLASS=\"status$severity\">$severity</TD></TR>" if ( $debug ...
             last;
           }
         }

        $debugfileMessage .= "</TABLE>\n";
      }
    }

    $debugfileMessage .= "<TABLE WIDTH=\"100%\" cellspacing=\"1\" cellpadding=\"1\"><TR style=\"font: normal 68% verdana,arial,helvetica; background:#c9c9c9;\"><TH>&nbsp;</TH><TD WIDTH=\"80\" ALIGN=\"CENTER\" CLASS=\"status". $STATE{$_severity}. "\">...
    $debugfileMessage .= "<BR><HR><BR>";

    # print table Virtual Servers Detail
    $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR><TD>\n<H3 style=\"margin-bottom: 0.5em; font: bold 90% verdana,arial,helvetica\">Virtual Servers Detail</H3></TD></TR></TABLE>";

    foreach my $trapServerName (sort keys %tableVirtualServersDetail) {
      $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR style=\"font: normal bold 79% verdana,arial,helvetica; text-align:left; background:#a6caf0;\"><TH>Virtual Server: $trapServerName</TH></TR></TABLE>\n";
      my $eventname = $tableVirtualServersDetail{$trapServerName};

      foreach my $key (sort { $b cmp $a } keys %$eventname) {
        $debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR style=\"font: normal bold 68% verdana,arial,helvetica; text-align:left; background:#a6a6a6;\"><TH>Eventname: $key</TH><TH WIDTH=\"180\">Traptime</TH><TH WIDTH=\"80\" ALIGN=\"CENTER\">Severity</T...
        my $uniqueTrap = $eventname->{$key};
        my $backgroundColor = '#eeeee0';

        foreach my $key (sort { $b cmp $a } keys %$uniqueTrap) {
          my $detail = $uniqueTrap->{$key};
          $backgroundColor = ($backgroundColor eq '#eeeee0') ? '#e1e1ef' : '#eeeee0';

          foreach my $key (sort { $b cmp $a } keys %$detail) {
            $debugfileMessage .= "<TR style=\"font: normal 68% verdana,arial,helvetica; background:$backgroundColor;\">". $detail->{$key} ."</TR>";
          }
        }

        $debugfileMessage .= "</TABLE>\n";
      }

      $debugfileMessage .= "<BR>\n";
    }

    $debugfileMessage .= "<P style=\"font: normal 68% verdana,arial,helvetica;\" ALIGN=\"left\">Generated on: " .scalar(localtime()). "</P>\n</BODY>\n</HTML>";
    $objectPlugins->write_debugfile ( \$debugfileMessage, 0 );

    my ($number, $tAlertFixed, $tAlertVariable);
    $tAlertFixed = $tAlertVariable = '';
    $number = 0;
    while ( my ($key, $value) = each(%tableVirtualServers) ) { $tAlertFixed .= "+$key"; $tAlertVariable .= "+$key $value"; $number++; }

    if ($number) {
      my $alert = "$tAlertVariable+, $tAlertFixed+" ;

plugins/templates/check_template-WebTransact-XML-Cactus-parser.pl  view on Meta::CPAN

  $objectPlugins->pluginValues ( { stateValue => $ERRORS{UNKNOWN}, error => 'Wrong # of tests, Known: $numberTests, Returned: '. $xml->{testsuite}->{tests}, result => undef }, $TYPE{APPEND} );
  $objectPlugins->exit (7);
}

if ($xml->{testsuite}->{failures} + $xml->{testsuite}->{errors}) {
  $objectPlugins->pluginValues ( { stateValue => $ERRORS{CRITICAL}, alert => "Tests $xml->{testsuite}->{tests} - Failures $xml->{testsuite}->{failures} - Errors $xml->{testsuite}->{errors}", result => undef }, $TYPE{APPEND} );
  $returnCode = $ERRORS{CRITICAL};
}

my ($alertHeader, $alertMessage, $debugfileMessage);
$debugfileMessage  = "\n<HTML><HEAD><TITLE>Cactus XML::Parser \@ $APPLICATION: Unit Test Results</TITLE></HEAD><BODY><HR><H1 style=\"margin: 0px 0px 5px; font: 125% verdana,arial,helvetica\">WebTransact XML Cactus parser @ $APPLICATION: Unit Test Res...
$debugfileMessage .= "<HR><H2 style=\"margin-top: 1em; margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica\">Summary</H2>";
$debugfileMessage .= "<TABLE WIDTH=\"100%\"><TR style=\"font: normal 68% bold verdana,arial,helvetica; text-align:left; background:#a6caf0;\"><TH>Tests</TH><TH>Failures</TH><TH>Errors</TH><TH>Time</TH><TR>";
$debugfileMessage .= "<TR style=\"background:#eeeee0; font: normal 68% bold verdana,arial,helvetica; color:purple;\"><TD>$xml->{testsuite}->{tests}</TD><TD>$xml->{testsuite}->{failures}</TD><TD>$xml->{testsuite}->{errors}</TD><TD>$xml->{testsuite}->{...

if ($xml->{testsuite}->{time} >= $timeTestsuiteCritical) {
  $returnCode  = $ERRORS{CRITICAL};
  $alertHeader = "Time $xml->{testsuite}->{time} > $timeTestsuiteCritical";
  $debugfileMessage .= " > $timeTestsuiteCritical";
} elsif ($xml->{testsuite}->{time} >= $timeTestsuiteWarning) {
  $returnCode  = $ERRORS{WARNING};
  $alertHeader = "Time $xml->{testsuite}->{time} > $timeTestsuiteWarning";
  $debugfileMessage .= " > $timeTestsuiteWarning";
} else {
  $alertHeader = "Time $xml->{testsuite}->{time}";
}

$debugfileMessage .= "</TD></TR></TABLE>\n";
$debugfileMessage .= "<table width=\"100%\" border=\"0\"><tr><td style=\"font: verdana,arial,helvetica; text-align: justify;\">Note: <i>failures</i> are anticipated and checked for with assertions while <i>errors</i> are unanticipated.</td></tr></tab...
$debugfileMessage .= "<H3 style=\"margin-bottom: 0.5em; font: bold 90% verdana,arial,helvetica\">Testcase $xml->{testsuite}->{name}</H3><TABLE WIDTH=\"100%\"><TR style=\"font: normal 68% bold verdana,arial,helvetica; text-align:left; background:#a6ca...
					
foreach my $testcase (@testcase) {
  my $nameTestcase = $testcase->[TESTCASE];

  if (defined $xml->{testsuite}->{testcase}->{$nameTestcase}) {
    if (defined $xml->{testsuite}->{testcase}->{$nameTestcase}->{failure}) {
      $alertMessage .= "+$nameTestcase:F";
      $debugfileMessage .= "<TR valign=\"top\" style=\"background:#eeeee0; font: normal 68% bold verdana,arial,helvetica; color:purple;\"><TD>$nameTestcase</TD><TD>Failure</TD><TD>$xml->{testsuite}->{testcase}->{$nameTestcase}->{failure}->{message}<B...
    } elsif (defined $xml->{testsuite}->{testcase}->{$nameTestcase}->{error}) {
      $alertMessage .= "+$nameTestcase:E";
      $debugfileMessage .= "<TR valign=\"top\" style=\"background:#eeeee0; font: normal 68% bold verdana,arial,helvetica; color:red;\"><TD>$nameTestcase</TD><TD>Error</TD><TD>$xml->{testsuite}->{testcase}->{$nameTestcase}->{error}->{message}<BR>&nbsp...
    } elsif ($xml->{testsuite}->{testcase}->{$nameTestcase}->{time} >= $testcase->[CRITICAL]) {
      $alertHeader  .= "+$nameTestcase:C $xml->{testsuite}->{testcase}->{$nameTestcase}->{time}";
      $alertMessage .= "+$nameTestcase:C";
      $debugfileMessage .= "<TR valign=\"top\" style=\"background:#eeeee0; font: normal 68% bold verdana,arial,helvetica; color:red;\"><TD>$nameTestcase</TD><TD>Critical</TD><TD>$xml->{testsuite}->{testcase}->{$nameTestcase}->{time} >= $testcase->[CR...
    } elsif ($xml->{testsuite}->{testcase}->{$nameTestcase}->{time} >= $testcase->[WARNING]) {
      $alertHeader  .= "+$nameTestcase:W $xml->{testsuite}->{testcase}->{$nameTestcase}->{time}";
      $alertMessage .= "+$nameTestcase:W";
      $debugfileMessage .= "<TR valign=\"top\" style=\"background:#eeeee0; font: normal 68% bold verdana,arial,helvetica; color:purple;\"><TD>$nameTestcase</TD><TD>Warning</TD><TD>$xml->{testsuite}->{testcase}->{$nameTestcase}->{time} >= $testcase->[...
    }
  }
}

$debugfileMessage .= "\n</TABLE><P style=\"font: normal 68% verdana,arial,helvetica;\" ALIGN=\"left\">Generated on: ". scalar(localtime()) ."</P>\n</BODY>\n</HTML>";

if (defined $alertMessage) {
  $objectPlugins->pluginValues ( { stateValue => $ERRORS{CRITICAL}, alert => $alertHeader .', '. $objectPlugins->pluginValue ('alert') .' '. $alertMessage .'+', result => undef }, $TYPE{REPLACE} );
  $objectPlugins->write_debugfile ( \$debugfileMessage, 0 );
} elsif ($returnCode == $ERRORS{DEPENDENT}) {
  $objectPlugins->pluginValues ( { stateValue => $ERRORS{OK}, alert => $xml->{testsuite}->{name}, result => undef }, $TYPE{APPEND} );
} else {
  my $alert = $objectPlugins->pluginValue ('alert');
  $objectPlugins->pluginValues ( { stateValue => $returnCode, alert => $alertHeader . (defined $alert ? ', '. $alert : ''), result => undef }, $TYPE{REPLACE} );
}



( run in 0.816 second using v1.01-cache-2.11-cpan-49f99fa48dc )