ASNMTAP

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
TODO:                          - TODO ALL   -  Log::Dispatch, Log::Dispatch::FileRotate depend on Date::Manip depend on perl 5.10
                               -               , 'Log::Dispatch' => '2.26'
                               -               , 'Log::Dispatch::FileRotate' => '1.19'
                               -               , 'Log::Log4perl::Layout::XMLLayout' => 'x.x'
 
Version 3.002.003, 2011/xx/yy, by Alex Peeters
                               ASNMTAP
                               - Nagios.pm
                                 BUGFIX: convert_from_KB_to_metric for GB
                                 BUGFIX: DESTROY created new reference to dead object 'ASNMTAP::Asnmtap::Plugins::Nagios' during global destruction.
                               - WebTransact.pm
                                 UPDATE: added Content_Type: 'multipart/form-data' for qs-fixed
                               - change code to use 'perfdata'
                               - UPDATE: asnmtap-3.002.003_mysql-v5.0.x-trigger-events.sql
                               - UPDATE: asnmtap-3.002.003_mysql-v5.0.x-trigger-eventsUpdate.sql
                               - runCmdOnDemand.pl & WebTransact.pm
                                 - replace <BODY onload="..."> with <BODY>
                               - SOAP.pm
                                 NEW: encodingStyle
                                                                                                                                 NEW: error 'Missing SOAP Envelope or Body'

Makefile.PL  view on Meta::CPAN

527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
if ( $ASNMTAP_PLUGINS or $ASNMTAP_APPLICATIONS ) {
  foreach my $prerequisite ( @prerequisites ) {
    my ($feature, $default, $files) = ( @{$prerequisite}[1], @{$prerequisite}[4..5] );
 
    if ( $default == 1 || $default == 2 ) {
      if ( defined $files ) {
        foreach ( @$files ) {
          my $file  = @$_[0];
          my $mode  = @$_[1];
          my @files = glob($file);
 
          foreach my $file (@files) {
            my $destination = ( $file =~ /^\// ? $file : $ASNMTAP_PATH .'/'. $file );
            $destination .= '-orig' if ( $mode =~ /^[RX]$/ );
            $file = substr($file, 1) if ( $file =~ /^\// );
 
            if ( $mode =~ /^[dD]$/ ) {
              $file .= '/.exists';
                                $destination .= '/.exists';
            }

README  view on Meta::CPAN

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
TODO:                          - TODO ALL   -  Log::Dispatch, Log::Dispatch::FileRotate depend on Date::Manip depend on perl 5.10
                               -               , 'Log::Dispatch' => '2.26'
                               -               , 'Log::Dispatch::FileRotate' => '1.19'
                               -               , 'Log::Log4perl::Layout::XMLLayout' => 'x.x'
 
Version 3.002.003, 2011/xx/yy, by Alex Peeters
                               ASNMTAP
                               - Nagios.pm
                                 BUGFIX: convert_from_KB_to_metric for GB
                                 BUGFIX: DESTROY created new reference to dead object 'ASNMTAP::Asnmtap::Plugins::Nagios' during global destruction.
                               - WebTransact.pm
                                 UPDATE: added Content_Type: 'multipart/form-data' for qs-fixed
                               - change code to use 'perfdata'
                               - UPDATE: asnmtap-3.002.003_mysql-v5.0.x-trigger-events.sql
                               - UPDATE: asnmtap-3.002.003_mysql-v5.0.x-trigger-eventsUpdate.sql
                               - runCmdOnDemand.pl & WebTransact.pm
                                 - replace <BODY onload="..."> with <BODY>
                               - SOAP.pm
                                 NEW: encodingStyle
                                                                                                                                 NEW: error 'Missing SOAP Envelope or Body'

applications/archive.pl  view on Meta::CPAN

190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
  my $day   = get_day   ('today');
  createCommentsAndEventsArchiveTables ( '+1 year' ) if ($month == 12 and $day >= 24);
  archiveCommentsAndEventsTables ( '-14 days', '-1 year' );
}
 
removeCgisessFiles ($removeCgisessEpoch) if ($doCgisess);
 
my $emailreport = "\nRemove *-MySQL-sql-error.txt:\n-----------------------------\n";
if ( $debug ) { print "$emailreport"; } else { print EMAILREPORT "$emailreport"; }
 
my @sqlErrorTxtFiles = glob("$RESULTSPATH/*-MySQL-sql-error.txt");
 
foreach my $sqlErrorTxtFile (@sqlErrorTxtFiles) {
  if ($debug) {
    print "E- unlink <$sqlErrorTxtFile>\n";
  } else {
    print EMAILREPORT "E- unlink <$sqlErrorTxtFile>\n";
  }
 
  unlink ($sqlErrorTxtFile);
}

applications/archive.pl  view on Meta::CPAN

815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
}
 
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
sub removeCgisessFiles {
  my ($removeCgisessEpoch) = @_;
 
  my $emailreport = "\nRemove cgisess files:\n---------------------\n";
  if ( $debug ) { print "$emailreport"; } else { print EMAILREPORT "$emailreport"; }
 
  my @cgisessPathFilenames = glob("$CGISESSPATH/cgisess_*");
 
  foreach my $cgisessPathFilename (@cgisessPathFilenames) {
    my (undef, $cgisessFilename) = split (/^$CGISESSPATH\//, $cgisessPathFilename);
    my (undef, $sessionID) = split (/^cgisess_/, $cgisessFilename);
    print "Filename      : <$cgisessFilename><$sessionID>\n" if ($debug >= 2);
    my ($sessionExists, %session) = get_session_param ($sessionID, $CGISESSPATH, $cgisessFilename, $debug);
 
    if ( $sessionExists ) {
      if (defined $session{ASNMTAP}) {
        if ($session{ASNMTAP} eq 'LEXY') {

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

731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
# plugins uploaded <-> plugins configurated - - - - - - - - - - - -
$matchingWarnings .= "<tr bgcolor=\"$COLORSTABLE{ENDBLOCK}\"><td align=\"center\" colspan=\"3\">Plugins Uploaded <-> Plugins Configurated</td></tr><tr bgcolor=\"$COLORSTABLE{STARTBLOCK}\"><td>Plugin</td><td>Message</td><td align=\"center\">Acti...
$sql = "SELECT DISTINCT test FROM $SERVERTABLPLUGINS where catalogID = '$CATALOGID' and activated = 1";
$sth = $dbh->prepare( $sql ) or $rv = error_trap_DBI(*STDOUT, "Cannot dbh->prepare: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, -1, '', $sessionID);
$sth->execute() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->execute: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, -1, '', $sessionID) if $rv;
$sth->bind_columns( \$test) or $rv = error_trap_DBI(*STDOUT, "Cannot sth->bind_columns: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, -1, '', $sessionID) if $rv;
 
if ( $rv ) {
  if ( $sth->rows ) {
    my @plugins = glob("$PLUGINPATH/*.pl");
 
    while( $sth->fetch() ) {
      my $teller = 0;
 
      foreach my $plugin (@plugins) {
        if ( defined $plugin and defined $test and $plugin eq "$PLUGINPATH/$test" ) {
          $plugins[$teller] = undef;
          last;
        }

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

803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
# help plugin filenames <-> plugin  - - - - - - - - - - - - - - - -
$matchingWarnings .= "<tr bgcolor=\"$COLORSTABLE{ENDBLOCK}\"><td align=\"center\" colspan=\"3\">Help Plugin Filenames <-> Plugin</td></tr><tr bgcolor=\"$COLORSTABLE{STARTBLOCK}\"><td>Help Plugin Filename</td><td>Message</td><td align=\"center\"...
$sql = "SELECT DISTINCT helpPluginFilename FROM $SERVERTABLPLUGINS WHERE catalogID = '$CATALOGID' and helpPluginFilename != '<NIHIL>'";
$sth = $dbh->prepare( $sql ) or $rv = error_trap_DBI(*STDOUT, "Cannot dbh->prepare: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, -1, '', $sessionID);
$sth->execute() or $rv = error_trap_DBI(*STDOUT, "Cannot sth->execute: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, -1, '', $sessionID) if $rv;
$sth->bind_columns( \$helpPluginFilename) or $rv = error_trap_DBI(*STDOUT, "Cannot sth->bind_columns: $sql", $debug, $pagedir, $pageset, $htmlTitle, $subTitle, -1, '', $sessionID) if $rv;
 
if ( $rv ) {
  if ( $sth->rows ) {
    my @helpPluginFilenames = glob("$PDPHELPPATH/*");
 
    while( $sth->fetch() ) {
      my $teller = 0;
 
      foreach my $helpPluginPathFilename (@helpPluginFilenames) {
        if ( $helpPluginPathFilename eq "$PDPHELPPATH/$helpPluginFilename" ) {
          $helpPluginFilenames[$teller] = undef;
          last;
        }

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

119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
if ($binMasterOrSlave ne '<NIHIL>') {
  my ($capture_array, $daemonCaptureHeader, $daemonCaptureStatus, $daemonCaptureParent);
  my (%daemonCaptureArrayName, %daemonCaptureArrayPid, %daemonCaptureArrayParent) = ();
  my (%daemonProcessTableParent, %daemonProcessTableChild, %daemonProcessTableSubChild) = ();
 
  $command = "asnmtap-$status.sh status";
  print "<P class=\"RunStatusOnDemandHtmlTitle\">$htmlTitle: <font class=\"RunStatusOnDemandCommand\">$APPLICATIONPATH/$binMasterOrSlave/$command</font></P><IMG SRC=\"".$IMAGESURL."/gears.gif\" HSPACE=\"0\" VSPACE=\"0\" BORDER=\"0\" NAME=\"Progre...
 
  my $_ppid = 1;
 
  if (-e '/usr/bin/zonename') { # Solaris 10 root into an non global zone where pid != 1 & pid == ppid
    my $zonename = `/usr/bin/zonename`;
 
    if ( $zonename ne 'global' ) {
      $_ppid = `ps -e -o 'pid ppid zone fname' | grep zsched | awk '{print \$1}'`;
    }
  }
 
  my @capture_array = `cd $APPLICATIONPATH/$binMasterOrSlave; $PERLCOMMAND $command 2>&1`;
 
  my $tProcessTable = new Proc::ProcessTable;
 
  my $daemonPidStatus = ( ($status eq 'display') ? 'Display' : ( ($status eq 'collector') ? 'Collector' : 'importDataThroughCatalog' ) );
 
  my $prefix = ( ( $status eq 'importDataThroughCatalog' ) ? '' : 'CT-');
 
  my @daemonPidPathFilenames = glob("$PIDPATH/${daemonPidStatus}$prefix". ( $prefix eq '' ? '' : '*' ) ."\.pid");
 
  foreach my $daemonPidPathFilename (@daemonPidPathFilenames) {
    my $rvOpen = open(PID, "$daemonPidPathFilename");
 
    if ($rvOpen) {
      my $pid;
      while (<PID>) { chomp; $pid = $_; }
      close(PID);
 
      if ( $prefix eq '' ) {

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

140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
$matchingSessionsActive  = "$table        <tr bgcolor=\"$COLORSTABLE{NOBLOCK}\"><th colspan=\"$colspan\">Active Sessions</th></tr>\n$header";
$matchingSessionsExpired = "$table        <tr bgcolor=\"$COLORSTABLE{NOBLOCK}\"><th colspan=\"$colspan\">Expired Sessions</th></tr>\n$header";
$matchingSessionsEmpty   = "$table        <tr bgcolor=\"$COLORSTABLE{NOBLOCK}\"><th colspan=\"$colspan\">Empty Sessions</th></tr>\n$header";
 
my ($numberRecordsIntoQueryBlocked, $numberRecordsIntoQueryActive, $numberRecordsIntoQueryExpired, $numberRecordsIntoQueryEmpty);
$numberRecordsIntoQueryBlocked = $numberRecordsIntoQueryActive = $numberRecordsIntoQueryExpired = $numberRecordsIntoQueryEmpty = 0;
 
my $currentTime = time();
my $solaris = (-e '/usr/sbin/nslookup') ? 1 : 0; # solaris
 
@cgisessPathFilenames = glob("$CGISESSPATH/cgisess_*");
 
foreach my $cgisessPathFilename (@cgisessPathFilenames) {
  my (undef, $cgisessFilename) = split (/^$CGISESSPATH\//, $cgisessPathFilename);
  (undef, $CsessionID) = split (/^cgisess_/, $cgisessFilename);
  my ($sessionExists, %session) = get_session_param ($CsessionID, $CGISESSPATH, $cgisessFilename, $debug);
 
  if ( $sessionExists ) {
    my $sessionCtime = (defined $session{_SESSION_CTIME})       ? $session{_SESSION_CTIME}       : undef;
    my $sessionAtime = (defined $session{_SESSION_ATIME})       ? $session{_SESSION_ATIME}       : undef;
    my $sessionEtime = (defined $session{_SESSION_ETIME})       ? $session{_SESSION_ETIME}       : undef;

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

235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
if(window.addEventListener) window.addEventListener("load",OLonLoad_handler,false);
else if (window.attachEvent) window.attachEvent("onload",OLonLoad_handler);
 
var capExtent;
 
////////
// PUBLIC FUNCTIONS
////////
 
// overlib(arg0,...,argN)
// Loads parameters into global runtime variables.
function overlib() {
        if (!olLoaded || isExclusive(overlib.arguments)) return true;
        if (olCheckMouseCapture) olMouseCapture();
        if (over) {
                over = (typeof over.id != 'string') ? o3_frame.document.all['overDiv'] : over;
                cClick();
        }
 
        // Load defaults to runtime.
  olHideDelay=0;

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

47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Set runtime variables
function setExclusiveVariables() {
        o3_exclusive = ol_exclusive;
        o3_exclusivestatus = ol_exclusivestatus;
}
 
// Parses Exclusive Parameters
function parseExclusiveExtras(pf,i,ar) {
        var k = i,v;
 
        olOverrideIsSet = false;  // a global variable
 
        if (k < ar.length) {
                if (ar[k] == EXCLUSIVEOVERRIDE) { if(pf !=  'ol_') olOverrideIsSet = true; return k; }
                if (ar[k] == EXCLUSIVE) { eval(pf +  'exclusive = (' +  pf + 'exclusive == 0) ? 1 : 0'); return k; }
                if (ar[k] == EXCLUSIVESTATUS) { eval(pf + "exclusivestatus = '" + escSglQuote(ar[++k]) + "'"); return k; }
        }
 
        return -1;
}

applications/htmlroot/snmptraps/etc/config.ini.php  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
;<?/*
;#########################################################
;#         SNMPTraps-Frontend for Nagios & ASNMTAP       #
;#                                                       #
;#                    by Michael Lübben                  #
;#                   --- Lizenz GPL ---                  #
;#########################################################
 
[global]
;# Select here a language (EN = English / DE = German)
language = EN
 
;# When you will use a authentification, then enable this option  (0=off / 1=on)
useAuthentification = 1
 
;# If you use the authentification, then entry here the User that
;# may changes on the Web-Frontend comma seperated.
allowedUser = ape,yvdh,snmptt

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

45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
   }
return($state);
    }
 
    /**
    * Read Trap-Information from database
    *
    * @author Michael Luebben <michael_luebben@web.de>
    */
function readTrapInfo() {
       global $table;
       $DATABASE = new database($configINI);
       $DATABASE->connect();
       $trapInfo = $DATABASE->infoTrap($table['name']);
       return($trapInfo);
    }
     
    /**
    * Check if use unknown-Traps in the Database
    *
    * @param boolean $useUnknownTraps

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

95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
    /**
    * 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>
    */
    function readTraps() {
       global $configINI, $FRONTEND;
       $step = $configINI['global']['step'];
       if(!$_GET['site']){
      $site = 0;
      $from = 1;
      $to = $step;
      $limit = "0,$step";
   } else {
      $site = $_GET['site'];
      $from = ($site*$step)+1;
      $to = (($site*$step)+$step);
      $limit = ($site*$step).",".$step;

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

152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
   $page = $site + 1;
   $wantedRecordFirst = ($page * $step) + 1;
   $TwantedRecordLast = $wantedRecordFirst + ($step - 1);
   $wantedRecordLast  = ($TwantedRecordLast < $countRecords[0]) ? $TwantedRecordLast : $countRecords[0];
   $numberOffRecords  = (($wantedRecordLast - 1) % $step) + 1;
   $numberOffPagesMax = floor((($countRecords[0] - 1) / $step) + 1);
   $this->site[] = '<table border="0" width="100%"><tr><td align="center" width="36"><B>'.$from.'-'.$to.'</B></td><td align="center">';
   if ($wantedRecordLast > 1) {
      $urlWithAccessParameters = 'index.php?severity='.$_REQUEST['severity'].'&amp;category='.rawurlencode($_REQUEST['category']).'&amp;hostname='.$_REQUEST['hostname'].'&amp;trapOID='.$_REQUEST['trapOID'].'&amp;FQDN='.$_REQUEST['FQDN'];
      if ($page > 1) {
         $this->site[] = "      &nbsp;<a href=\"$urlWithAccessParameters&amp;site=0\"><IMG SRC=\"$ICONSRECORD{first}\" ALT=\"First\" BORDER=0></a>&nbsp;<a href=\"$urlWithAccessParameters&amp;site=". ($site - 1) ."\"><IMG SRC=\"". $configINI['g...
      } else {
         $this->site[] = '      &nbsp;1';
      }
      for ($currentPage = 2; $currentPage < $numberOffPagesMax; $currentPage++) {
         if ( $page != $currentPage ) {
            $offsetOffRecords = ($step * ($currentPage - 1));
            $this->site[] = "      &nbsp;<a href=\"$urlWithAccessParameters&amp;site=". ($currentPage - 1) ."\">$currentPage</a>";
         } else {
            $this->site[] = "      &nbsp;$currentPage";
         }
      }
      if ($page < $numberOffPagesMax) {
         $this->site[] = "      &nbsp;<a href=\"$urlWithAccessParameters&amp;site=". ($numberOffPagesMax - 1) ."\">$numberOffPagesMax</a>&nbsp;&nbsp;<a href=\"$urlWithAccessParameters&amp;site=". ($site + 1) ."\"><IMG SRC=\"". $configINI['glob...
      } else {
         $this->site[] = "      &nbsp;$numberOffPagesMax";
      }
      $this->site[] = '</td><td align="center" width="36"><B>'. $page .'/'. $numberOffPagesMax .'</B>';
   } else {
      $this->site[] = '      &nbsp;';
   }
   $this->site[] = '      </td></tr></table>';
}

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

187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
}
 
/**
    * Check a page with read traps form database
    *
    * @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";

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

234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
   }  
}
 
/**
* Create entry for Category, if selected table not "unknown"
*
* @author Michael Luebben <michael_luebben@web.de>
*
*/
function createCategoryEntry() {
   global $table,$languageXML;
   if($table['name'] != "snmptt_unknown") {
      $this->site[] = '                     <TR>';
  $this->site[] = '                        <TD VALIGN="top" ALIGN="left" CLASS="filterName">'.$languageXML['LANG']['HEADER']['FILTER']['CATEGORY'].':</TD>';
  $this->site[] = '                        <TD VALIGN="top" ALIGN="left" CLASS="filterName">';
  $this->site[] = '                            '.common::checkRequest(rawurldecode($_REQUEST['category']));
  $this->site[] = '                        </TD>';
  $this->site[] = '                     </TR>';
   }
}
 
/**
* Create filter menu for categories
*
* @author Michael Luebben <michael_luebben@web.de>
*
*/
function createCategoryFilter() {
   global $table,$languageXML;
   if($table['name'] != "snmptt_unknown") {
      $DATABASE = new database($configINI);
      $DATABASE->connect();
      $allCategory = $DATABASE->readCategory($table['name']);
  if ($allCategory) {
        $this->site[] = '               <TR>';
    $this->site[] = '                  <TD ALIGN="left" COLSPAN="2" CLASS="optBoxItem">'.$languageXML['LANG']['HEADER']['OPTBOX']['CATEGORY'].':</TD>';
    $this->site[] = '               <TR>';
    $this->site[] = '                  <TD ALIGN="left" COLSPAN="2" class="optBoxItem">';
    $this->site[] = '                     <SELECT NAME="category">';

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

68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
}
 
// ======================= Contructor and functions for the header of the frontend ======================
 
/**
* Constructor for the header
*
* @author Michael Luebben <michael_luebben@web.de>
*/
function constructorHeader() {
    global $table;
        $this->site[] = '<TABLE BORDER="0" WIDTH="100%" CELLPADDING="0" CELLSPACING="0">';
        $this->site[] = '   <TR>';
        $this->site[] = '      <TD ALIGN="left" VALIGN="top" WIDTH="33%">';
        $this->createInfoBox();
        $this->site[] = '         <BR>';
        $this->createFilter();
        $this->site[] = '      </TD>';
        $this->site[] = '      <TD ALIGN="center" VALIGN="top" WIDTH="33%">';
        $this->createNavBox();
        $this->site[] = '         <BR>';

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

95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
        $this->site[] = '</TABLE>';
        $this->site[] = '<BR><BR>';
}
 
/**
* Create a Info-Box
*
* @author Michael Luebben <michael_luebben@web.de>
*/
function createInfoBox() {
    global $languageXML;
        $this->site[] = '         <TABLE CLASS="infoBox" BORDER="1" CELLPADDING="0" CELLSPACING="0">';
        $this->site[] = '            <TR>';
$this->site[] = '               <TD CLASS="infoBox">';
$this->site[] = '                  <DIV CLASS="infoBoxTitle">'.$languageXML['LANG']['HEADER']['INFOBOX']['CURRENTTRAPLOG'].'</DIV>';
$trapInfo = common::readTrapInfo();
// FIXME: View function.php --> Class common!
$this->site[] = '                  '.$languageXML['LANG']['HEADER']['INFOBOX']['LASTUPDATE'].': '.$trapInfo['last'].'<BR>';
$this->site[] = '                  Nagios&reg; - <A HREF="http://www.nagios.org" TARGET="_blank" CLASS="homepageURL">www.nagios.org</A><BR>';
$this->site[] = '                  ASNMTAP&copy; - <A HREF="http://asnmtap.citap.be" TARGET="_blank" CLASS="homepageURL">asnmtap.citap.be</A><BR>';
$this->site[] = '                  NagTrap&copy; by Michael L&#252;bben &amp; Alex Peeters<BR>';

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

118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
$this->site[] = '            </TR>';
        $this->site[] = '         </TABLE>';
}
 
/**
* Create a Filter-Box
*
* @author Michael Luebben <michael_luebben@web.de>
*/
function createFilter() {
        global $languageXML, $configINI;
        $this->site[] = '         <TABLE BORDER="1" CLASS="filter" CELLSPACING="0" CELLPADDING="0">';
        $this->site[] = '            <TR>';
$this->site[] = '               <TD CLASS="filter">';
$this->site[] = '                  <TABLE BORDER="0" CELLSPACING="2" CELLPADDING="0">';
$this->site[] = '                     <TR>';
$this->site[] = '                        <TD COLSPAN="2" VALIGN="top" ALIGN="left" CLASS="filterTitle">'.$languageXML['LANG']['HEADER']['FILTER']['DISPLAYFILTERS'].':</TD>';
$this->site[] = '                        <TD></TD>';
$this->site[] = '                     </TR>';
$this->site[] = '                     <TR>';
$this->site[] = '                        <TD VALIGN="top" ALIGN="left" CLASS="filterName">'.$languageXML['LANG']['HEADER']['FILTER']['HOST'].':</TD>';

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

164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
$this->site[] = '            </TR>';
        $this->site[] = '         </TABLE>';
 
/**
* Create a Navigation-Box
*
* @author Michael Luebben <michael_luebben@web.de>
*/
function createNavBox() {
    global $languageXML;
$this->site[] = '         <TABLE CLASS="navBox" BORDER="0" CELLSPACING="0" CELLPADDING="0">';
$this->site[] = '            <TR>';
$this->site[] = '               <TD ALIGN="center" VALIGN="middle" CLASS="navBoxItem">';
$this->site[] = '                  <IMG SRC="'.$this->configINI['nagios']['images'].'empty.gif" ALT="" BORDER="0" WIDTH="75" HEIGHT="1">';
$this->site[] = '               </TD>';
$this->site[] = '               <TD WIDTH=15></TD>';    
$this->site[] = '               <TD ALIGN="center" CLASS="navBoxDate">';
$this->site[] = '                  <DIV CLASS="navBoxTitle">'.$languageXML['LANG']['HEADER']['NAVBOX']['LOGFILENAV']['LINE1'].'<BR>'.$languageXML['LANG']['HEADER']['NAVBOX']['LOGFILENAV']['LINE2'].'</DIV><BR>';
$trapInfo = common::readTrapInfo();
$this->site[] = '                     '.$trapInfo['first'];

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

192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
$this->site[] = '            </TR>';
$this->site[] = '         </TABLE>';
}
 
/**
* Create a Database-Information for the Nagigation
*
* @author Michael Luebben <michael_luebben@web.de>
*/
function createDBInfo($table) {
    global $languageXML;
    $this->site[] = '         <DIV CLASS="navBoxFile">';
        $this->site[] = '            '.$languageXML['LANG']['HEADER']['DBINFO']['DATABASE'].': '.$this->configINI['database']['name'].' '.$languageXML['LANG']['HEADER']['DBINFO']['TABLE'].': '.$table['name'];
        $this->site[] = '         </DIV>';
}
   
/**
* Create a Box for Options
*
* @author Michael Luebben <michael_luebben@web.de>
*/
function createOptBox() {
    global $languageXML;
$this->site[] = '         <FORM METHOD="get" ACTION="./index.php">';
$this->site[] = '            <TABLE BORDER="0" CLASS="optBox">';
$this->site[] = '               <TR>';
$this->site[] = '                  <TD ALIGN="left" COLSPAN="2" CLASS="optBoxItem">'.$languageXML['LANG']['HEADER']['OPTBOX']['SEVERITYDETAIL'].':</TD>';
$this->site[] = '               </TR>';
$this->site[] = '               <TR>';
$this->site[] = '                  <TD ALIGN="left" COLSPAN="2" class="optBoxItem">';
$this->site[] = '                     <SELECT NAME="severity">';
$this->site[] = '                        <OPTION VALUE="" '.common::selected("",$_REQUEST['severity'],"selected").' >'.$languageXML['LANG']['HEADER']['OPTBOX']['OPTION']['VALUEALL'].'</OPTION>';
$this->site[] = '                        <OPTION VALUE="OK" '.common::selected("OK",$_REQUEST['severity'],"selected").' >Traps ok</OPTION>';
$this->site[] = '                        <OPTION VALUE="WARNING" '.common::selected("WARNING",$_REQUEST['severity'],"selected").' >Traps warning</OPTION>';
$this->site[] = '                        <OPTION VALUE="CRITICAL" '.common::selected("CRITICAL",$_REQUEST['severity'],"selected").' >Traps critical</OPTION>';
$this->site[] = common::checkIfEnableUnknownTraps($this->configINI['global']['useUnknownTraps']);
$this->site[] = '                     </SELECT>';
$this->site[] = '                  </TD>';
$this->site[] = '               </TR>';
$this->site[] = common::createCategoryFilter();
        $this->site[] = '               <TR>';
        $this->site[] = '                  <TD ALIGN="left" CLASS="optBoxItem">'.$languageXML['LANG']['HEADER']['OPTBOX']['OLDERENTRIESFIRST'].':</TD>';
        $this->site[] = '                  <TD></TD>';
        $this->site[] = '               </TR>';
        $this->site[] = '               <TR>';
$this->site[] = '                  <TD ALIGN="left" VALIGN="bottom" CLASS="optBoxItem"><INPUT TYPE="checkbox" name="oldestfirst" '.common::selected("on",$_REQUEST['oldestfirst'],"checked").' ></TD>';

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

246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
}
  
 /**
 * Create a error-message
 *
 * @param string $error
 *
 * @author Michael Luebben <michael_luebben@web.de>
 */
 function printError($error,$systemError) {
    global $errorXML;
    $this->site[] = '<HR>';
    $this->site[] = '   <DIV CLASS="errorMessage">'.$errorXML['ERROR'][$error]['MESSAGE'].'</DIV>';
    common::printErrorLines($errorXML['ERROR'][$error]['DESCRIPTION'],$systemError);
    $this->site[] = '</HR>';
 }
  
 // ======================== Contructor and functions for the main of the frontend =======================
  
 /**
 * Constructor for the main
 *
 * @author Michael Luebben <michael_luebben@web.de>
 */
 function constructorMain() {
    global $languageXML, $traps, $MAIN;
    // Check database connacetion and read traps from database
    $traps = common::readTraps();
    $this->site[] = '<FORM NAME="form1" ACTION="./index.php" METHOD="POST">';
    $this->site[] = '<TABLE WIDTH="100%" BORDER="0">';
    $this->site[] = '   <TR>';
 
    /**
    * @author Alex Peeters [alex.peeters@citap.be]
*/
if ($MAIN->checkAction() == "1") {

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

303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
       $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>';

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

338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
 // ======================= Contructor and functions for the footer of the frontend ======================
  
 /**
 * Constructor for the main
 *
 * @author Michael Luebben <michael_luebben@web.de>
 */
 //FIXME !!!
 function constructorFooter() {
    global $configINI, $languageXML, $MAIN;
    $this->site[] = '<TABLE WIDTH="100%" BORDER="0">';
    $this->site[] = '   <TR>';
    $this->site[] = '      <TD CLASS="linkBox">';
 
    /**
    * @author Alex Peeters [alex.peeters@citap.be]
*/
if ($MAIN->checkAction() == "1") {
       $this->site[] = '         <IMG SRC="'.$configINI['global']['images'].$configINI['global']['iconStyle'].'/arrow.png" ALT="" BORDER="0">';
       $this->site[] = '         <INPUT TYPE="checkbox" NAME="checkbox" VALUE="checkbox" onClick="checkAll(\'yes\'); return true;">(Mark all)';
       $this->site[] = '         <INPUT TYPE="image" SRC="'.$configINI['global']['images'].$configINI['global']['iconStyle'].'/mark.png" NAME="markTraps[0]" TITLE="'.$languageXML['LANG']['MAIN']['TRAPTABLEENTRY']['OPTIONREAD'].'">';
       $this->site[] = '         <INPUT TYPE="image" SRC="'.$configINI['global']['images'].$configINI['global']['iconStyle'].'/delete.png" NAME="deleteTraps[0]" TITLE="'.$languageXML['LANG']['MAIN']['TRAPTABLEENTRY']['OPTIONDELETE'].'">';
    }
 
    $this->site[] = '         <INPUT TYPE="hidden" NAME="oldestfirst" VALUE="'.$_REQUEST['oldestfirst'].'">';
$this->site[] = '         <INPUT TYPE="hidden" NAME="severity" VALUE="'.$_REQUEST['severity'].'">';
    $this->site[] = '         <INPUT TYPE="hidden" NAME="category" VALUE="'.$_REQUEST['category'].'">';
    $this->site[] = '         <INPUT TYPE="hidden" NAME="hostname" VALUE="'.$_REQUEST['hostname'].'">';
    $this->site[] = '         <INPUT TYPE="hidden" NAME="trapOID" VALUE="'.$_REQUEST['trapOID'].'">';
    $this->site[] = '         <INPUT TYPE="hidden" NAME="FQDN" VALUE="'.$_REQUEST['FQDN'].'">';
    $this->site[] = '      </TD>';        
    $this->site[] = '   </TR>';

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

87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
     
    /**
    * Check which table was used
    *
    * @param string $tableName
    * @param string $optionSeverity
    *
    * @author Michael Luebben <michael_luebben@web.de>
*/
function setTable($tableName,$optionSeverity) {
   global $configINI;
       if(!isset($tableName))
   {
      $table['name'] = $configINI['database']['tableSnmptt'];
   }
    
       if($optionSeverity == "UNKNOWN") {
      $table['name'] = $configINI['database']['tableSnmpttUnk'];
      $table['severity'] = "all";
   } elseif($optionSeverity == "OK" or $optionSeverity == "WARNING" or $optionSeverity == "CRITICAL") {
      $table['severity'] = $optionSeverity;

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

113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
         
        /**
        * Checked logged in User, when authentification was enabled
        *
        * @param string $useAuthenfication
        * @param string $loggedInUser
        *
        * @author Michael Luebben <michael_luebben@web.de>
    */
        function checkUser() {
           global $configINI;
           $userAllowed = "0";
           if ($configINI['global']['useAuthentification'] == "0") {
              $userAllowed = "1"
           } else {
              $authorized = explode(",",$configINI['global']['allowedUser']);
                  if (in_array($_SERVER['PHP_AUTH_USER'],$authorized)) {
             $userAllowed ="1";
          }      
           }
           return($userAllowed);
        }
         
        /**
        * Checked logged in User, when authentification was enabled
        *
        * @param string $useAuthenfication
        * @param string $allowedAction
        *
        * @author Alex Peeters [alex.peeters@citap.be]
    */
        function checkAction() {
           global $configINI;
           $actionAllowed = "0";
           if ($configINI['global']['useAuthentification'] == "0") {
              $actionAllowed = "1"
           } else {
              $authorized = explode(",",$configINI['global']['allowedAction']);
                  if (in_array($_SERVER['PHP_AUTH_USER'],$authorized)) {
             $actionAllowed ="1";
          }      
           }
           return($actionAllowed);
        }
}
?>

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

25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
}
  
 /**
 * Make a connection to the database
 *
 * @param array $configINI
 *
 * @author Michael Luebben <michael_luebben@web.de>
 */ 
 function connect() {
global $configINI, $FRONTEND;
$connect = @mysql_pconnect($configINI['database']['host'], $configINI['database']['user'], $configINI['database']['password']);
$dbSelect['code'] = @mysql_select_db($configINI['database']['name'], $connect);
// On error, create a array entry with the mysql error
if(!$dbSelect['code']) {
   $FRONTEND->printError("DBCONNECTION",mysql_error());
           $FRONTEND->closeSite();
   $FRONTEND->printSite();
   exit;
}
return($dbSelect);

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

48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/**
    * Read Traps from database
    *
    * @param string $sort
    * @param boolean $limit
    * @param array $table
    *
    * @author Michael Luebben <michael_luebben@web.de>
    */ 
function readTraps($limit) {
   global $table, $FRONTEND;
       /**
       * @author Alex Peeters [alex.peeters@citap.be]
   */
   // Create WHERE clausel
   if($_REQUEST['severity'] == "" and $_REQUEST['hostname'] == "" and $_REQUEST['trapOID'] == "" and $_REQUEST['category'] == "") {
      $dbQuery = '';
   } elseif ($_REQUEST['severity'] == "UNKNOWN" and $_REQUEST['hostname'] == "" and $_REQUEST['trapOID'] == "") {
      $dbQuery = '';
   } else {
      if($_REQUEST['severity'] != "UNKNOWN") {

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

136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
 /**
 * Handle a Traps in the database
 *
 * @param boolean $trapID
 * @param string $tableName
 *
 * @author Michael Luebben <michael_luebben@web.de>
 */ 
 function handleTrap($handle,$trapID,$tableName) {
    global $configINI, $FRONTEND;
    if($handle == "mark") {
   $query = "UPDATE $tableName SET trapread = 1 WHERE id = $trapID";
}elseif($handle == "delete") {
   if($configINI['database']['tableArchiveExt'] != "") {
      if($configINI['database']['tableSnmpttUnk'] == $tableName) {
        $query = "REPLACE INTO $tableName". $configINI['database']['tableArchiveExt'] ." SELECT * FROM $tableName WHERE id = $trapID";
      }else{
        $query = "REPLACE INTO $tableName". $configINI['database']['tableArchiveExt'] ." SELECT * FROM $tableName WHERE id = $trapID and category <> 'ASNMTAP'";
      }
      $result = mysql_query($query);

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

174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
}
 
/**
    * Read Trap-Infromation from the database
    *
    * @param string $tableName
    *
    * @author Michael Luebben <michael_luebben@web.de>
    */ 
function infoTrap($tableName) {
   global $FRONTEND;
   $query = "SELECT id,traptime FROM $tableName ORDER BY id";
   $result = mysql_query($query);
   if(!$result) {
      $FRONTEND->printError("DBREADTRAP",mysql_error());
              $FRONTEND->closeSite();
      $FRONTEND->printSite();
      exit;
   }
   while ($line = mysql_fetch_array($result)) {
      $trapTime[] = $line['traptime'];

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

200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
   return($trap);
}
 
    /**
    * Read category from database
    *
    * @author Michael Luebben <michael_luebben@web.de>
    *
    */
    function readCategory($tableName) {
       global $FRONTEND;
       $query = "SELECT DISTINCT category FROM $tableName";
       $result = mysql_query($query);
       if(!$result) {
      $FRONTEND->printError("DBREADCATEGORY",mysql_error());
              $FRONTEND->closeSite();
      $FRONTEND->printSite();
      exit;
   }
 
       while ($line = mysql_fetch_array($result)) {

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

242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
        nd = no_overlib;
        ver3fix = true;
}
 
 
////////
// PUBLIC FUNCTIONS
////////
 
// overlib(arg0,...,argN)
// Loads parameters into global runtime variables.
function overlib() {
        if (!olLoaded || isExclusive(overlib.arguments)) return true;
        if (olCheckMouseCapture) olMouseCapture();
        if (over) {
                over = (typeof over.id != 'string') ? o3_frame.document.all['overDiv'] : over;
                cClick();
        }
 
        // Load defaults to runtime.
  olHideDelay=0;

applications/htmlroot/snmptraps/index.php  view on Meta::CPAN

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
require("./include/classes/class.frontend.php");
require("./include/classes/class.common.php");
require("./include/classes/class.mysqlDB.php");
 
$MAIN = new main();
 
// Read config.ini.php
$configINI = $MAIN->readConfig("./etc/config.ini.php");
 
// Read error.xml for error-messages
$errorXML = $MAIN->readXML("./include/xml/language/".$configINI['global']['language']."/error.xml");
 
// Read language
$languageXML = $MAIN->readXML("./include/xml/language/".$configINI['global']['language']."/main.xml");
 
// Set table
$table = $MAIN->setTable($tableName,$_REQUEST['severity']);
 
$FRONTEND = new frontend($configINI);
 
$FRONTEND->openSite();
 
$FRONTEND->constructorHeader();

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

705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
// Check an onMouseDown event to see if we should hide
function PopupWindow_hideIfNotClicked(e) {
        if (this.autoHideEnabled && !this.isClicked(e)) {
                this.hidePopup();
                }
        }
// Call this to make the DIV disable automatically when mouse is clicked outside it
function PopupWindow_autoHide() {
        this.autoHideEnabled = true;
        }
// This global function checks all PopupWindow objects onmouseup to see if they should be hidden
function PopupWindow_hidePopupWindows(e) {
        for (var i=0; i<popupWindowObjects.length; i++) {
                if (popupWindowObjects[i] != null) {
                        var p = popupWindowObjects[i];
                        p.hideIfNotClicked(e);
                        }
                }
        }
// Run this immediately to attach the event listener
function PopupWindow_attachListener() {

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

58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
was "none". Tests can check for the parameter and skip if not set.
 
Responses are stored in an external, file-based
cache so subsequent test runs will use these values. The user is able
to change the values by amending the values in the file /var/tmp/NPTest.pm,
or by setting the appropriate environment variable before running the test.
 
The option exists to store parameters in a scoped means, allowing a
test harness to a localise a parameter should the need arise. This
allows a parameter of the same name to exist in a test harness
specific scope, while not affecting the globally scoped parameter. The
scoping identifier is the name of the test harness sans the trailing
".t".  All cache searches first look to a scoped parameter before
looking for the parameter at global scope. Thus for a test harness
called "check_disk.t" requesting the parameter "mountpoint_valid", the
cache is first searched for "check_disk"/"mountpoint_valid", if this
fails, then a search is conducted for "mountpoint_valid".
 
To facilitate quick testing setup, it is possible to accept all the
developer provided defaults by setting the environment variable
"NPTEST_ACCEPTDEFAULT" to "1" (or any other perl truth value). Note
that, such defaults are not stored in the cache, as there is currently
no mechanism to edit existing cache entries, save the use of text
editor or removing the cache file completely.

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

367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
      $userResponse = $default;
    }
  }
 
  print STDERR "\n";
 
  if ($userResponse =~ /^(na|none)$/) {
        $userResponse = '';
  }
 
  # define all user responses at global scope
  SetCacheParameter( $param, ( $scoped ? $testharness : undef ), $userResponse );
 
  return $userResponse;
}
 
#
# Internal Cache Management Functions
#
 
sub SearchCache

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

156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
=item namespace
 
Sets the URI that will be used as the namespace for the resulting XML entity.
 
 
a required scalar.
 
=item registerNamespace
 
The register_ns subroutine allows users to register a global namespace with the SOAP Envelope.
 
 registerNamespace:
 
 %soapService_Register_NS = (
   'http://www.w3.org/2001/XMLSchema'      => 's'
 );
 
a required hash.

plugins/nagios/check_fs-stat.pl  view on Meta::CPAN

88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
my $debug = $objectPlugins->getOptionsValue ('debug');
 
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Start plugin  - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
my $now = time();
use Fcntl ':mode';
 
my @files = glob ("$directory/$wildcard");
 
my ($nDirectories, $wDirectories, $cDirectories, $nFiles, $wFiles, $cFiles) = (0, 0, 0, 0, 0, 0);
 
foreach (@files){
  my ($mode, $mtime) = ( stat($_) )[2, 10];
  my $dTime = ( defined $mtime ) ? $now - $mtime : 0;
 
  if ( $type =~ /^[FB]$/ and S_ISREG($mode) ) {
    $nFiles++;
    $wFiles++ if ( $dTime > $wAge );

plugins/templates/check_file-counter.pl  view on Meta::CPAN

68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Start plugin  - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
my $wOffset = DAY * $wDays if (defined $wDays);
my $cOffset = DAY * $cDays if (defined $cDays);
 
my ($nFiles, $cTime, $cFiles, $wFiles) = (0, time(), 0 , 0);
 
my @files = glob ("$parameters/*");
use Fcntl ':mode';
 
foreach (@files){
  my ($mode, $ctime) = ( stat($_) )[2,10];
  my $dTime = $cTime - $ctime;
 
  if ( S_ISREG($mode) ) {
    $nFiles++;
    $wFiles++ if ( defined $wOffset and $dTime > $wOffset );
    $cFiles++ if ( defined $cOffset and $dTime > $cOffset );



( run in 0.405 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )