view release on metacpan or search on metacpan
141516171819202122232425262728293031323334TODO: - 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
527528529530531532533534535536537538539540541542543544545546547if
(
$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'
;
}
121314151617181920212223242526272829303132TODO: - 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
190191192193194195196197198199200201202203204205206207208209210
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
) {
"$emailreport"
; }
else
{
EMAILREPORT
"$emailreport"
; }
my
@sqlErrorTxtFiles
=
glob
(
"$RESULTSPATH/*-MySQL-sql-error.txt"
);
foreach
my
$sqlErrorTxtFile
(
@sqlErrorTxtFiles
) {
if
(
$debug
) {
"E- unlink <$sqlErrorTxtFile>\n"
;
}
else
{
EMAILREPORT
"E- unlink <$sqlErrorTxtFile>\n"
;
}
unlink
(
$sqlErrorTxtFile
);
}
applications/archive.pl view on Meta::CPAN
815816817818819820821822823824825826827828829830831832833834835}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub
removeCgisessFiles {
my
(
$removeCgisessEpoch
) =
@_
;
my
$emailreport
=
"\nRemove cgisess files:\n---------------------\n"
;
if
(
$debug
) {
"$emailreport"
; }
else
{
EMAILREPORT
"$emailreport"
; }
my
@cgisessPathFilenames
=
glob
(
"$CGISESSPATH/cgisess_*"
);
foreach
my
$cgisessPathFilename
(
@cgisessPathFilenames
) {
my
(
undef
,
$cgisessFilename
) =
split
(/^
$CGISESSPATH
\//,
$cgisessPathFilename
);
my
(
undef
,
$sessionID
) =
split
(/^cgisess_/,
$cgisessFilename
);
"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
731732733734735736737738739740741742743744745746747748749750# 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
803804805806807808809810811812813814815816817818819820821822# 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
119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156if
(
$binMasterOrSlave
ne
'<NIHIL>'
) {
my
(
$capture_array
,
$daemonCaptureHeader
,
$daemonCaptureStatus
,
$daemonCaptureParent
);
my
(
%daemonCaptureArrayName
,
%daemonCaptureArrayPid
,
%daemonCaptureArrayParent
) = ();
my
(
%daemonProcessTableParent
,
%daemonProcessTableChild
,
%daemonProcessTableSubChild
) = ();
$command
=
"asnmtap-$status.sh status"
;
"<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
140141142143144145146147148149150151152153154155156157158159160$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
235236237238239240241242243244245246247248249250251252253254255if
(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
4748495051525354555657585960616263646566// 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
123456789101112131415161718;<?/*
;
#########################################################
;
# 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
454647484950515253545556575859606162636465
}
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
);
}
/**
*
*
@param
boolean
$useUnknownTraps
applications/htmlroot/snmptraps/include/classes/class.common.php view on Meta::CPAN
9596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
/**
* 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
152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
$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'
].
'&category='
.rawurlencode(
$_REQUEST
[
'category'
]).
'&hostname='
.
$_REQUEST
[
'hostname'
].
'&trapOID='
.
$_REQUEST
[
'trapOID'
].
'&FQDN='
.
$_REQUEST
[
'FQDN'
];
if
(
$page
> 1) {
$this
->site[] =
" <a href=\"$urlWithAccessParameters&site=0\"><IMG SRC=\"$ICONSRECORD{first}\" ALT=\"First\" BORDER=0></a> <a href=\"$urlWithAccessParameters&site="
. (
$site
- 1) .
"\"><IMG SRC=\""
.
$configINI
['g...
}
else
{
$this
->site[] =
' 1'
;
}
for
(
$currentPage
= 2;
$currentPage
<
$numberOffPagesMax
;
$currentPage
++) {
if
(
$page
!=
$currentPage
) {
$offsetOffRecords
= (
$step
* (
$currentPage
- 1));
$this
->site[] =
" <a href=\"$urlWithAccessParameters&site="
. (
$currentPage
- 1) .
"\">$currentPage</a>"
;
}
else
{
$this
->site[] =
" $currentPage"
;
}
}
if
(
$page
<
$numberOffPagesMax
) {
$this
->site[] =
" <a href=\"$urlWithAccessParameters&site="
. (
$numberOffPagesMax
- 1) .
"\">$numberOffPagesMax</a> <a href=\"$urlWithAccessParameters&site="
. (
$site
+ 1) .
"\"><IMG SRC=\""
.
$configINI
['
glob
...
}
else
{
$this
->site[] =
" $numberOffPagesMax"
;
}
$this
->site[] =
'</td><td align="center" width="36"><B>'
.
$page
.
'/'
.
$numberOffPagesMax
.
'</B>'
;
}
else
{
$this
->site[] =
' '
;
}
$this
->site[] =
' </td></tr></table>'
;
}
applications/htmlroot/snmptraps/include/classes/class.common.php view on Meta::CPAN
187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230}
/**
* 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
234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
}
}
/**
* 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
686970717273747576777879808182838485868788}
// ======================= 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
9596979899100101102103104105106107108109110111112113114115
$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® - <A HREF="http://www.nagios.org" TARGET="_blank" CLASS="homepageURL">www.nagios.org</A><BR>'
;
$this
->site[] =
' ASNMTAP© - <A HREF="http://asnmtap.citap.be" TARGET="_blank" CLASS="homepageURL">asnmtap.citap.be</A><BR>'
;
$this
->site[] =
' NagTrap© by Michael Lübben & Alex Peeters<BR>'
;
applications/htmlroot/snmptraps/include/classes/class.frontend.php view on Meta::CPAN
118119120121122123124125126127128129130131132133134135136137138$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
164165166167168169170171172173174175176177178179180181182183184$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
192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237$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
246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281}
/**
* 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
303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
$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&trapID='
.
$trap
[
'id'
].
'&severity='
.
$_REQUEST
[
'severity'
].
'&category='
.rawurlencode(
$_REQUEST
[
'category'
]).
'&hostname='
.
$_REQUEST
[
'hostname'
].
'&trapOID='
.
$_REQUEST
['t...
// Delete a trap
$this
->site[] =
' <A HREF="./index.php?action=delete&trapID='
.
$trap
[
'id'
].
'&severity='
.
$_REQUEST
[
'severity'
].
'&category='
.rawurlencode(
$_REQUEST
[
'category'
]).
'&hostname='
.
$_REQUEST
[
'hostname'
].
'&trapOID='
.
$_REQUEST
[...
$this
->site[] =
' </TD>'
;
}
// Select host
$this
->site[] =
' <TD CLASS="'
.
$rowColor
.
'"><P '
.
$styleLine
.
'><A HREF="./index.php?severity='
.
$_REQUEST
[
'severity'
].
'&category='
.rawurlencode(
$_REQUEST
[
'category'
]).
'&hostname='
.
$trap
[
'hostname'
].
'&FQDN=T">'
.
$trap
[
'hostname'
].'</...
// Select trapOID
$this
->site[] =
' <TD CLASS="'
.
$rowColor
.
'"><P '
.
$styleLine
.
'><A HREF="./index.php?severity='
.
$_REQUEST
[
'severity'
].
'&category='
.rawurlencode(
$_REQUEST
[
'category'
]).
'&hostname='
.
$trap
[
'hostname'
].
'&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
338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
// ======================= 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
87888990919293949596979899100101102103104105106107
/**
* 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
113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
/**
* 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
252627282930313233343536373839404142434445}
/**
* 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
484950515253545556575859606162636465666768/**
* 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
136137138139140141142143144145146147148149150151152153154155156
/**
* 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
174175176177178179180181182183184185186187188189190191192193194}
/**
* 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
200201202203204205206207208209210211212213214215216217218219220
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
242243244245246247248249250251252253254255256257258259260261262
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
89101112131415161718192021222324252627282930require
(
"./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
705706707708709710711712713714715716717718719720721722723724725// 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
585960616263646566676869707172737475767778798081was
"none"
. Tests can check
for
the parameter and skip
if
not set.
Responses are stored in an external, file-based
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
editor or removing the cache file completely.
lib/ASNMTAP/Asnmtap/Plugins/NPTest.pm view on Meta::CPAN
367368369370371372373374375376377378379380381382383384385386387
$userResponse
=
$default
;
}
}
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
156157158159160161162163164165166167168169170171172173174175=item namespace
Sets the URI that will be used as the namespace for the resulting XML entity.
namespace: 'http://www.soaplite.com/Demo'
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://schemas.xmlsoap.org/wsdl/mime/' => 'mime',
'http://www.w3.org/2001/XMLSchema' => 's'
);
a required hash.
plugins/nagios/check_fs-stat.pl view on Meta::CPAN
888990919293949596979899100101102103104105106107108my
$debug
=
$objectPlugins
->getOptionsValue (
'debug'
);
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Start plugin - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
my
$now
=
time
();
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
686970717273747576777879808182838485868788# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# 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/*"
);
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
);