view release on metacpan or search on metacpan
- version update DateTime 0.37
- version update Email::Simple 1.999
- version update ExtUtils::MakeMaker 6.32
- version update IO::Socket::SSL 1.040
- version update Net::LDAP 0.34
- version update Time::HiRes 1.9705
- version update WSRF::Lite 0.8.2.1
MANIFEST
- NEW check_template-WebTransact-XML-Monitoring.pl
- NEW check_template-WebTransact-XML-Monitoring.t
- NEW check_template-WebTransact-with-client-authorization.pl
- NEW check_template-WebTransact-with-client-authorization.t
README
- updated INSTALLATION procedure
Applications.cnf
#<DATABASE_ACCOUNT>
# <SERVER>
# VERSION 4.x # '4.x' or '5.0.x'
# MERGE 0 # '0' or '1'
# </SERVER>
ASNMTAP::Asnmtap::*
- optimalisation for MySQL queries
- NEW create_weblogic_configuration_database_with_SNMP.pl
- NEW create_weblogic_configuration_database_with_SNMP.SQL
ASNMTAP::Asnmtap::Plugins::Mail.pm
- FIX regarding MIME-Encoding '7bit' and code optimalisation
- NEW MIME-Encoding: '8bit', 'binhex', 'binary', 'x-gzip64', 'x-uu' & 'x-uuencode'
- overview MIME-Encoding: '7bit', '8bit', 'quoted-printable', 'base64', 'binhex', 'binary', 'x-gzip64', 'x-uu' & 'x-uuencode'
ASNMTAP::Asnmtap::Plugins::Nagios
- NEW check_network_interface_status.pl
- NEW snmptt_traps_remove_pending_and_duplicated.pl
ASNMTAP::Asnmtap::SOAP.pm
- NEW added basic authentication and credentials
- NEW added soapaction and readable
ASNMTAP::Asnmtap::Plugins::WebTransact.pm
- NEW Inherited LWP user agent object: $objectWebTransact->ua = LWP::UserAgent->new;
check_template-WebTransact-XML-Monitoring.pl & check_template-WebTransact-XML-Monitoring.t
- NEW WebTransact plugin template for XML Monitoring
check_template-WebTransact-with-client-authorization.pl & check_template-WebTransact-with-client-authorization.t
- NEW WebTransact plugin template with client authorization
detailedStatisticsReportGenerationAndCompareResponsetimeTrends.pl
- add corresponding comments to the report
generateReports.pl & getArchivedReport.pl
- add support for timeperiod
Version 3.000.013, 2007/02/25, ASNMTAP
- add BEGIN { if ( $ENV{ASNMTAP_PERL5LIB} ) { eval 'use lib ( "$ENV{ASNMTAP_PERL5LIB}" )'; } }
- FIX replace <script language="JavaScript..."> with <script language="JavaScript..." type="text/javascript">
- UPDATE Mozilla/5.0 compatible
chmod 700 .ssh
chmod go-rwx .ssh/*
chmod 644 ssh.pub
chown asnmtap:asnmtap ssh.pub
chmod 600 ssh
chown apache:asnmtap ssh
# |------- user for web server
cat /home/asnmtap/.ssh/ssh.pub >> /home/asnmtap/.ssh/authorized_keys
chmod 600 /home/asnmtap/.ssh/authorized_keys
vi /home/asnmtap/.ssh/authorized_keys
add command='/opt/asnmtap/applications/sbin/sshWrapperASNMTAP.pl' before ssh.pub
httpd.conf
----------
vi /etc/httpd/conf.d/asnmtap.conf add the following content, and modify where needed like ServerName, ServerAlias, ErrorLog and CustomLog
AddHandler cgi-script .cgi .pl
DirectoryIndex index.htm index.html index.html.var index.shtml index.cfm index.pl
t/Templates/Plugins/Nagios/check_template-ftp.t
t/Templates/Plugins/Nagios/check_template-ldap.t
t/Templates/Plugins/Nagios/check_template-nagios.t
t/Templates/Plugins/Nagios/check_xml-monitoring.t
t/Templates/Plugins/Nagios/check_xml.t
t/Templates/Plugins/SOAP/check_template-SOAP.t
t/Templates/Plugins/WebTransact/check_template-WebTransact-Perfdata.t
t/Templates/Plugins/WebTransact/check_template-WebTransact-with-client-authorization.t
t/Templates/Plugins/WebTransact/check_template-WebTransact-with-client-certificate.t
t/Templates/Plugins/WebTransact/check_template-WebTransact-XML-Monitoring.t
t/Templates/Plugins/WebTransact/check_template-WebTransact-XML-Monitoring-1.1.t
t/Templates/Plugins/WebTransact/check_template-WebTransact-XML-Monitoring-1.2.t
t/Templates/Plugins/WebTransact/check_template-WebTransact-XML-Cactus-parser.t
t/Templates/Plugins/WebTransact/check_template-WebTransact-XML.t
t/Templates/Plugins/WebTransact/check_template-WebTransact.t
t/Templates/Plugins/XML/check_template-XML.t
plugins/templates/check_template-mail-xml-fingerprint-xml-monitoring.pl
plugins/templates/check_template-mail-xml-fingerprint-xml-monitoring-1.1.pl
plugins/templates/check_template-mail-xml.pl
plugins/templates/check_template-mail-fingerprint.pl
plugins/templates/check_template-modem.pl
plugins/templates/check_template-ras.pl
plugins/templates/check_template-SOAP.pl
plugins/templates/check_template-SNMPTT.pl
plugins/templates/check_template-WebTransact.pl
plugins/templates/check_template-WebTransact-Perfdata.pl
plugins/templates/check_template-WebTransact-with-client-authorization.pl
plugins/templates/check_template-WebTransact-with-client-certificate.pl
plugins/templates/check_template-WebTransact-XML.pl
plugins/templates/check_template-WebTransact-XML-Cactus-parser.pl
plugins/templates/check_template-WebTransact-XML-Monitoring.pl
plugins/templates/check_template-WebTransact-XML-Monitoring-1.1.pl
plugins/templates/check_template-WebTransact-XML-Monitoring-1.2.pl
plugins/templates/check_template-XML.pl
plugins/templates/dtd/email-upgrade-1.0.dtd
plugins/templates/dtd/FingerprintEmail-1.0.dtd
--- #YAML:1.0
name: ASNMTAP
version: 3.002003
abstract: Application System Network Monitoring Toolkit Alex Peeters
author:
- Alex Peeters <alex.peeters@citap.com>
license: perl
distribution_type: module
configure_requires:
ExtUtils::MakeMaker: 0
build_requires:
ExtUtils::MakeMaker: 0
requires:
Bundle::DBD::mysql: 4.004
Bundle::DBI: 1.604
ASNMTAP::Asnmtap::Plugins::Nagios
- ASNMTAP::Asnmtap::Plugins:
- Time::Local: 1.17
check_template-ldap.pl
- Net::LDAP:
Dependencies Net::LDAP:
- Convert::ASN1 - required
- URI::ldap - optional, needed for URL parsing
- Digest::MD5 - optional, needed for SASL CRAM-MD5 auth
- Net::SSLeay - optional, needed for IO::Socket::SSL
needed OpenSSL-0.9.7b or newer...
- IO::Socket::SSL - optional, needed for Net::LDAPS
- XML::Parser - optional, needed for Net::LDAP::DSML
ASNMTAP::Asnmtap::Plugins::Mail
- Date::Calc: 5.4
- Email::Simple: 1.996
- Mail::POP3Client 2.17
- Mail::Sendmail: 0.79
applications/display-test.pl view on Meta::CPAN
my ($statusMessage) = @_;
my $break = '';
my $errorMessage;
# ***************************************************************************
# The 400 series of Web error codes indicate an error with your Web browser *
# ***************************************************************************
if ($statusMessage =~ /400 Bad Request/ ) {
$errorMessage = 'The request could not be understood by the server due to incorrect syntax';
} elsif ($statusMessage =~ /401 Unauthorized User/ ) {
$errorMessage = 'The client does not have access to this resource, authorization is needed';
} elsif ($statusMessage =~ /402 Payment Required/ ) {
$errorMessage = 'Payment is required. Reserved for future use';
} elsif ($statusMessage =~ /403 Forbidden Connection/ ) {
$errorMessage = 'The server understood the request, but is refusing to fulfill it. Access to a resource is not allowed. The most frequent case of this occurs when directory listing access is not allowed';
} elsif ($statusMessage =~ /404 Page Not Found/ ) {
$errorMessage = 'The resource request was not found. This is the code returned for missing pages or graphics. Viruses will often attempt to access resources that do not exist, so the error does not necessarily represent a problem';
} elsif ($statusMessage =~ /405 Method Not Allowed/ ) {
$errorMessage = 'The access method (GET, POST, HEAD) is not allowed on this resource';
} elsif ($statusMessage =~ /406 Not Acceptable/ ) {
$errorMessage = 'None of the acceptable file types (as requested by client) are available for this resource';
} elsif ($statusMessage =~ /407 Proxy Authentication Required/ ) {
$errorMessage = 'The client does not have access to this resource, proxy authorization is needed';
} elsif ($statusMessage =~ /408 Request Timeout/ ) {
$errorMessage = 'The client did not send a request within the required time period';
} elsif ($statusMessage =~ /409 Conflict/ ) {
$errorMessage = 'The request could not be completed due to a conflict with the current state of the resource';
} elsif ($statusMessage =~ /410 Gone/ ) {
$errorMessage = 'The requested resource is no longer available at the server and no forwarding address is known. This condition is similar to 404, except that the 410 error condition is expected to be permanent. Any robot seeing this response sho...
} elsif ($statusMessage =~ /411 Length Required/ ) {
$errorMessage = 'The request requires the Content-Length HTTP request field to be specified';
} elsif ($statusMessage =~ /412 Precondition Failed/ ) {
$errorMessage = 'The precondition given in one or more of the request-header fields evaluated to false when it was tested on the server';
applications/display.pl view on Meta::CPAN
my ($statusMessage) = @_;
my $break = '';
my $errorMessage;
# ***************************************************************************
# The 400 series of Web error codes indicate an error with your Web browser *
# ***************************************************************************
if ($statusMessage =~ /400 Bad Request/ ) {
$errorMessage = 'The request could not be understood by the server due to incorrect syntax';
} elsif ($statusMessage =~ /401 Unauthorized User/ ) {
$errorMessage = 'The client does not have access to this resource, authorization is needed';
} elsif ($statusMessage =~ /402 Payment Required/ ) {
$errorMessage = 'Payment is required. Reserved for future use';
} elsif ($statusMessage =~ /403 Forbidden Connection/ ) {
$errorMessage = 'The server understood the request, but is refusing to fulfill it. Access to a resource is not allowed. The most frequent case of this occurs when directory listing access is not allowed';
} elsif ($statusMessage =~ /404 Page Not Found/ ) {
$errorMessage = 'The resource request was not found. This is the code returned for missing pages or graphics. Viruses will often attempt to access resources that do not exist, so the error does not necessarily represent a problem';
} elsif ($statusMessage =~ /405 Method Not Allowed/ ) {
$errorMessage = 'The access method (GET, POST, HEAD) is not allowed on this resource';
} elsif ($statusMessage =~ /406 Not Acceptable/ ) {
$errorMessage = 'None of the acceptable file types (as requested by client) are available for this resource';
} elsif ($statusMessage =~ /407 Proxy Authentication Required/ ) {
$errorMessage = 'The client does not have access to this resource, proxy authorization is needed';
} elsif ($statusMessage =~ /408 Request Timeout/ ) {
$errorMessage = 'The client did not send a request within the required time period';
} elsif ($statusMessage =~ /409 Conflict/ ) {
$errorMessage = 'The request could not be completed due to a conflict with the current state of the resource';
} elsif ($statusMessage =~ /410 Gone/ ) {
$errorMessage = 'The requested resource is no longer available at the server and no forwarding address is known. This condition is similar to 404, except that the 410 error condition is expected to be permanent. Any robot seeing this response sho...
} elsif ($statusMessage =~ /411 Length Required/ ) {
$errorMessage = 'The request requires the Content-Length HTTP request field to be specified';
} elsif ($statusMessage =~ /412 Precondition Failed/ ) {
$errorMessage = 'The precondition given in one or more of the request-header fields evaluated to false when it was tested on the server';
applications/htmlroot/AnchorPosition.js view on Meta::CPAN
// ===================================================================
// Author: Matt Kruse <matt@mattkruse.com>
// WWW: http://www.mattkruse.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download.
// If you wish to share this code with others, please just point them
// to the URL instead.
// Please DO NOT link directly to my .js files from your site. Copy
// the files to your server and use them there. Thank you.
applications/htmlroot/CalendarPopup.js view on Meta::CPAN
// ===================================================================
// Author: Matt Kruse <matt@mattkruse.com>
// WWW: http://www.mattkruse.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download.
// If you wish to share this code with others, please just point them
// to the URL instead.
// Please DO NOT link directly to my .js files from your site. Copy
// the files to your server and use them there. Thank you.
applications/htmlroot/PopupWindow.js view on Meta::CPAN
// ===================================================================
// Author: Matt Kruse <matt@mattkruse.com>
// WWW: http://www.mattkruse.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download.
// If you wish to share this code with others, please just point them
// to the URL instead.
// Please DO NOT link directly to my .js files from your site. Copy
// the files to your server and use them there. Thank you.
applications/htmlroot/date.js view on Meta::CPAN
// ===================================================================
// Author: Matt Kruse <matt@mattkruse.com>
// WWW: http://www.mattkruse.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download.
// If you wish to share this code with others, please just point them
// to the URL instead.
// Please DO NOT link directly to my .js files from your site. Copy
// the files to your server and use them there. Thank you.
applications/htmlroot/snmptraps/etc/config.ini.php view on Meta::CPAN
;# 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
;# If you use the authentification, then entry here the User that may 'mark as read'
;# or 'Delete this trap' on the Web-Frontend comma seperated.
allowedAction = ape,yvdh
;# Ignore this option, when you don`t use a table for archiving the Traps and/or
;# unknown-Traps in your database
tableArchive = _archive
;# When you use a database for unknown-Traps, then enable this option (0=off / 1=on)
;# If you enable this option, then you musst have a table in your database for unknown
;# traps.
applications/htmlroot/snmptraps/include/classes/class.common.php view on Meta::CPAN
/**
* This Class with functions for the frontend-class
*/
class common extends frontend {
/**
Check the Request (OK, WARNING, ......)
*
* @param string $request
*
* @author Michael Luebben <michael_luebben@web.de>
*/
function checkRequest($request) {
if (!isset($request) or $request == "")
{
$retRequest = 'All';
} else {
$retRequest = $request;
}
return($retRequest);
}
/**
* Check if the Option selected
*
* @param string $optionValue
* @param string $type
* @param string $sel
*
* @author Michael Luebben <michael_luebben@web.de>
*/
function selected($optionValue,$type,$sel) {
$state = '';
if ($optionValue == $type)
{
$state = $sel;
}
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
*
* @author Michael Luebben <michael_luebben@web.de>
*/
function checkIfEnableUnknownTraps($useUnknownTraps) {
unset($option);
if ($useUnknownTraps == "1") {
$option=' <OPTION VALUE="UNKNOWN" '.common::selected("UNKNOWN",$_REQUEST['severity'],"selected").' >Traps unknown</OPTION>';
}
return($option);
}
/**
* Print error-lines
*
* @param string $lines
*
* @author Michael Luebben <michael_luebben@web.de>
*/
function printErrorLines($errorLines,$systemError) {
$this->site[] = ' <DIV CLASS="errorDescription">';
foreach($errorLines as $lines) {
$this->site[] = ' '.$lines.'<BR>';
}
if($systemError) {
$this->site[] = ' Error: <I>'.$systemError.'</I>';
}
$this->site[] = ' </DIV>';
}
/**
* Delete not used fields in the frontend, when unknown-traps was selected
*
* @params string $action
*
* @author Michael Luebben <michael_luebben@web.de>
*/
function showTrapFields($action,$trap,$rowColor,$styleLine) {
if ($_REQUEST['severity'] != "UNKNOWN") {
if ($action == "field") {
global $languageXML;
$this->site[] = ' <TH CLASS="status">'.$languageXML['LANG']['MAIN']['TRAPTABLEHEADER']['CATEGORY'].'</TH>';
$this->site[] = ' <TH CLASS="status">'.$languageXML['LANG']['MAIN']['TRAPTABLEHEADER']['SEVERITY'].'</TH>';
}
elseif ($action == "entry") {
$this->site[] = ' <TD CLASS="'.$rowColor.'"><P '.$styleLine.'>'.$trap['category'].'</P></TD>';
$this->site[] = ' <TD CLASS="'.status.$trap['severity'].'" ALIGN="center"><P '.$styleLine.'>'.$trap['severity'].'</P></TD>';
}
}
}
/**
* Read Traps from Database and create Buttons for pages with limited trap entrys
*
* @author Jörg Linge
* @author Michael Luebben <michael_luebben@web.de>
*/
function readTraps() {
global $configINI, $FRONTEND;
$step = $configINI['global']['step'];
if(!$_GET['site']){
$site = 0;
$from = 1;
$to = $step;
$limit = "0,$step";
} else {
applications/htmlroot/snmptraps/include/classes/class.common.php view on Meta::CPAN
}
$DATABASE = new database($configINI);
$DATABASE->connect();
// Read traps from database
$traps = $DATABASE->readTraps($limit);
$count = sizeof($traps);
/**
* @author Alex Peeters [alex.peeters@citap.be]
*/
$countRecords = $DATABASE->readTraps('0');
if($countRecords[0] > $step){
if($to > $countRecords[0]){
$to = $countRecords[0];
}
$page = $site + 1;
$wantedRecordFirst = ($page * $step) + 1;
$TwantedRecordLast = $wantedRecordFirst + ($step - 1);
$wantedRecordLast = ($TwantedRecordLast < $countRecords[0]) ? $TwantedRecordLast : $countRecords[0];
applications/htmlroot/snmptraps/include/classes/class.common.php view on Meta::CPAN
}
return($traps);
}
/**
* 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 = '';
applications/htmlroot/snmptraps/include/classes/class.common.php view on Meta::CPAN
$rowColor = "statusEven";
$rowIndex = "0";
}
}
}
}
/**
* 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>';
applications/htmlroot/snmptraps/include/classes/class.frontend.php view on Meta::CPAN
*/
class frontend {
var $site;
/**
* Constructor
*
* @param config $configINI
*
* @author Michael Luebben <michael_luebben@web.de>
*/
function frontend(&$configINI) {
$this->configINI = &$configINI;
}
// ==================================== Functions to create the page ====================================
/**
* Open a Web-Site in a Array site[].
*
* @author Michael Luebben <michael_luebben@web.de>
*/
function openSite() {
$this->site[] = '<HTML>';
$this->site[] = '<HEAD>';
$this->site[] = '<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8"/>';
$this->site[] = '<TITLE>'.$this->configINI['internal']['title'].' '.$this->configINI['internal']['version'].'</TITLE>';
$this->site[] = '<SCRIPT TYPE="text/javascript" SRC="./include/js/nagtrap.js"></SCRIPT>';
$this->site[] = '<SCRIPT TYPE="text/javascript" SRC="./include/js/overlib.js"></SCRIPT>';
$this->site[] = '<LINK HREF="'.$this->configINI['nagios']['prefix'].'/include/css/nagtrap.css" REL="stylesheet" TYPE="text/css">';
$this->site[] = '<LINK HREF="'.$this->configINI['nagios']['prefix'].'/include/css/status.css" REL="stylesheet" TYPE="text/css">';
$this->site[] = '<LINK HREF="'.$this->configINI['nagios']['prefix'].'/include/css/showlog.css" REL="stylesheet" TYPE="text/css">';
$this->site[] = '<LINK HREF="'.$this->configINI['nagios']['prefix'].'/include/css/common.css" REL="stylesheet" TYPE="text/css">';
$this->site[] = '</HEAD>';
$this->site[] = '<BODY CLASS="status">';
}
/**
* Closed a Web-Site in the Array site[]
*
* @author Michael Luebben <michael_luebben@web.de>
*/
function closeSite() {
$this->site[] = '</BODY>';
$this->site[] = '</HTML>';
}
/**
* Create a Web-Side from the Array site[].
*
* @author Michael Luebben <michael_luebben@web.de>
*/
function printSite() {
foreach ($this->site as $row) {
echo $row."\n";
}
}
// ======================= 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>';
applications/htmlroot/snmptraps/include/classes/class.frontend.php view on Meta::CPAN
$this->createOptBox();
$this->site[] = ' </TD>';
$this->site[] = ' </TR>';
$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>';
applications/htmlroot/snmptraps/include/classes/class.frontend.php view on Meta::CPAN
$this->site[] = ' NagTrap© by Michael Lübben & Alex Peeters<BR>';
$this->site[] = ' '.$languageXML['LANG']['HEADER']['INFOBOX']['LOGGEDINAS'].' <I>'.$_SERVER['PHP_AUTH_USER'].'</I><BR>';
$this->site[] = ' </TD>';
$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>';
$this->site[] = ' <TD VALIGN="top" ALIGN="left" CLASS="filterName">';
$this->site[] = ' '.common::checkRequest($_REQUEST['hostname']);
$this->site[] = ' </TD>';
$this->site[] = ' </TR>';
// @author Alex Peeters [alex.peeters@citap.be]
$this->site[] = ' <TR>';
$this->site[] = ' <TD VALIGN="top" ALIGN="left" CLASS="filterName">'.$languageXML['LANG']['HEADER']['FILTER']['TRAPOID'].':</TD>';
$this->site[] = ' <TD VALIGN="top" ALIGN="left" CLASS="filterName">';
$this->site[] = ' '.common::checkRequest($_REQUEST['trapOID']);
$this->site[] = ' </TD>';
$this->site[] = ' </TR>';
$this->site[] = ' <TR>';
$this->site[] = ' <TD VALIGN="top" ALIGN="left" CLASS="filterName">'.$languageXML['LANG']['HEADER']['FILTER']['SEVERITYLEVEL'].':</TD>';
$this->site[] = ' <TD VALIGN="top" ALIGN="left" CLASS="filterName">';
applications/htmlroot/snmptraps/include/classes/class.frontend.php view on Meta::CPAN
$this->site[] = ' </TR>';
$this->site[] = ' </TABLE>';
$this->site[] = ' </TD>';
$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">';
applications/htmlroot/snmptraps/include/classes/class.frontend.php view on Meta::CPAN
$this->site[] = ' <TD>';
$this->site[] = ' <IMG SRC="'.$this->configINI['nagios']['images'].'empty.gif" ALT="" BORDER="0" WIDTH="75" HEIGHT="1">';
$this->site[] = ' </TD>';
$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">';
applications/htmlroot/snmptraps/include/classes/class.frontend.php view on Meta::CPAN
$this->site[] = ' </TR>';
$this->site[] = ' </TABLE>';
$this->site[] = ' </FORM>';
}
/**
* 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") {
$this->site[] = ' <TH CLASS="status" WIDTH="30">'.$languageXML['LANG']['MAIN']['TRAPTABLEHEADER']['OPTION'].'</TH>';
}
$this->site[] = ' <TH CLASS="status">'.$languageXML['LANG']['MAIN']['TRAPTABLEHEADER']['HOST'].'</TH>';
$this->site[] = ' <TH CLASS="status" WIDTH="30">'.$languageXML['LANG']['MAIN']['TRAPTABLEHEADER']['TRAPOID'].'</TH>';
$this->site[] = ' <TH CLASS="status">'.$languageXML['LANG']['MAIN']['TRAPTABLEHEADER']['TRAPTIME'].'</TH>';
common::showTrapFields("field",NULL,NULL,NULL);
$this->site[] = ' <TH CLASS="status">'.$languageXML['LANG']['MAIN']['TRAPTABLEHEADER']['MESSAGE'].'</TH>';
$this->site[] = ' </TR>';
common::createTrapPage($traps);
$this->site[] = '</TABLE>';
}
/**
* Create a Java Infobox
*
* @author Michael Luebben <michael_luebben@web.de>
*/
function javaInfoBox($formatline) {
$infoBox = 'onmouseover="return overlib(\'';
$infoBox .= $formatline;
$infoBox .= '\', CAPTION, \'Trap-Message\', VAUTO);" onmouseout="return nd();" ';
return($infoBox);
}
/**
* Show traps
*
* @author Michael Luebben <michael_luebben@web.de>
*/
function showTrap($trap,$rowColor,$styleLine) {
global $configINI, $languageXML, $MAIN;
$this->site[] = ' <TR>';
/**
* @author Alex Peeters [alex.peeters@citap.be]
*/
if ($MAIN->checkAction() == "1") {
// Checkbox
$this->site[] = ' <TD CLASS="'.$rowColor.'"><INPUT TYPE="checkbox" NAME="trapIDs[]" VALUE="'.$trap['id'].'" '.$_GET['sel'].'>';
// Mark a trap
$this->site[] = ' <A HREF="./index.php?action=mark&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>';
}
applications/htmlroot/snmptraps/include/classes/class.frontend.php view on Meta::CPAN
common::showTrapFields("entry",$trap,$rowColor,$styleLine);
$this->site[] = ' <TD CLASS="'.$rowColor.'"><P '.$styleLine.' '.$this->javaInfoBox($trap['orgFormatline']).'CLASS="formatline">'.htmlentities($trap['formatline']).'</P></TD>';
$this->site[] = ' </TR>';
}
// ======================= Contructor and functions for the footer of the frontend ======================
/**
* Constructor for the main
*
* @author Michael Luebben <michael_luebben@web.de>
*/
//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'].'">';
applications/htmlroot/snmptraps/include/classes/class.main.php view on Meta::CPAN
/**
* This Class with funtions
*/
class main {
/**
* Read the Config-File and return a array
*
* @param string $configFile
*
* @author Michael Luebben <michael_luebben@web.de>
*/
function readConfig($configFile) {
$config = @parse_ini_file($configFile, TRUE) or die ("Could not open Configuration-File $configFile !");
return($config);
}
/**
* Replace characters
*
* @param string $String
*
* @author Michael Luebben <michael_luebben@web.de>
*/
function replaceCharacters($string) {
$searchChr = array('ä', 'ü', 'ö', 'Ä', 'Ü', 'Ö', 'ß');
$searchChr = array('_a_', '_u_', '_o_', '_A_', '_U_', '_O_', '_sz_');
$replaceChr = array('ä', 'ü', 'ö', 'Ä', 'Ü', 'Ö', 'ß');
foreach ($searchChr as $key=>$character) {
$string = str_replace($searchChr[$key], $replaceChr[$key], $string);
}
return($string);
}
/**
* Read a XML-File and return a array
*
* @param string $XMLFile
*
* @author Michael Luebben <michael_luebben@web.de>
*/
function readXML($xmlFile) {
$xml_parser = xml_parser_create();
if (!($fp = fopen($xmlFile, "r"))) {
die("Could not open XML-File $xmlFile !");
}
$data = fread($fp, filesize($xmlFile));
fclose($fp);
applications/htmlroot/snmptraps/include/classes/class.main.php view on Meta::CPAN
}
return($params);
}
/**
* 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;
} else {
$table['severity'] = "all";
}
return($table);
}
/**
* 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
*/
class database {
/**
* Constructor
*
* @param config $configINI
*
* @author Michael Luebben <michael_luebben@web.de>
*/
function database(&$configINI) {
$this->configINI = &$configINI;
}
/**
* 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();
applications/htmlroot/snmptraps/include/classes/class.mysqlDB.php view on Meta::CPAN
return($dbSelect);
}
/**
* 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") {
if ($_REQUEST['severity'] != "") {
if ($_REQUEST['severity'] == "OK") {
applications/htmlroot/snmptraps/include/classes/class.mysqlDB.php view on Meta::CPAN
}
return($traps);
}
/**
* 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{
applications/htmlroot/snmptraps/include/classes/class.mysqlDB.php view on Meta::CPAN
exit;
}
return($result);
}
/**
* 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;
applications/htmlroot/snmptraps/include/classes/class.mysqlDB.php view on Meta::CPAN
if ($trapTime[0] != "") {
$trap[last] = array_pop($trapTime);
$trap[first] = array_pop(array_reverse($trapTime));
}
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();
applications/htmlroot/snmptraps/include/xml/language/DE/error.xml view on Meta::CPAN
<?xml version="1.0" encoding="UTF-8" ?>
<error>
<authentification>
<message>Konnte Logdatei nicht lesen - Sie scheinen nicht die benötigten Rechte zu besitzen!</message>
<description>
<line1>Bitte _u_berpr_u_fen Sie die Schreib-/Leserechte des Webservers sowie die </line1>
<line2>Authentifizierungsoptionen in den Konfigurationsdateien</line2>
</description>
</authentification>
<dbConnection>
<message>Datenbankfehler</message>
<description>
<line1>Konnte keine Verbindung zur Datenbank herstellen!</line1>
<line2>Bitte _u_berpr_u_fen Sie die Konfiguration...</line2>
</description>
</dbConnection>
<dbTable>
<message>Datenbankfehler</message>
<description>
applications/htmlroot/snmptraps/include/xml/language/EN/error.xml view on Meta::CPAN
<?xml version="1.0" encoding="UTF-8" ?>
<error>
<authentification>
<message>It appears as though you do not have permission to view the log file ...</message>
<description>
<line1>If you believe this is an error, check the HTTP server authentication requirements for accessing this site</line1>
<line2>and check the authorization options in your configuration file.</line2>
</description>
</authentification>
<dbConnection>
<message>Database-Error</message>
<description>
<line1>Can't connect to database!</line1>
<line2>Check your configuration!</line2>
</description>
</dbConnection>
<dbTable>
<message>Database-Error</message>
<description>
applications/tools/resources/CalendarPopup-combined-compact.js view on Meta::CPAN
// ===================================================================
// Author: Matt Kruse <matt@mattkruse.com>
// WWW: http://www.mattkruse.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download.
// If you wish to share this code with others, please just point them
// to the URL instead.
// Please DO NOT link directly to my .js files from your site. Copy
// the files to your server and use them there. Thank you.
applications/tools/resources/CalendarPopup-combined.js view on Meta::CPAN
// ===================================================================
// Author: Matt Kruse <matt@mattkruse.com>
// WWW: http://www.mattkruse.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download.
// If you wish to share this code with others, please just point them
// to the URL instead.
// Please DO NOT link directly to my .js files from your site. Copy
// the files to your server and use them there. Thank you.
applications/tools/templates/master/rsync-wrapper-distributed-example.sh view on Meta::CPAN
print SSHOUT ("ARG0 = $rsync_argv[0]\n") if ($debug);
print SSHOUT ("ARG1 = $rsync_argv[1]\n") if ($debug);
print SSHOUT ("ARG2 = $rsync_argv[2]\n") if ($debug);
print SSHOUT ("ARG3 = $rsync_argv[3]\n") if ($debug);
print SSHOUT ("ARG4 = $rsync_argv[4]\n") if ($debug);
print SSHOUT ("ARG5 = $rsync_argv[5]\n") if ($debug && $rsync_argv[2] eq '--sender');
# ARG[0] Complain if the command is not 'rsync'.
unless ($rsync_argv[0] =~ 'rsync') {
print SSHOUT ("ssh authorized_key account restricted: only rsync allowed\n");
$ok = $FALSE;
}
# ARG[1] Complain if this arg is not --server
unless ($rsync_argv[1] eq '--server') {
print SSHOUT ("ARG[1] <$rsync_argv[1]> Failure: this arg is not --server\n");
$ok = $FALSE;
}
# ARG[2] Check if this arg is --sender
applications/tools/templates/master/rsync-wrapper-distributed-template.sh view on Meta::CPAN
print SSHOUT ("ARG0 = $rsync_argv[0]\n") if ($debug);
print SSHOUT ("ARG1 = $rsync_argv[1]\n") if ($debug);
print SSHOUT ("ARG2 = $rsync_argv[2]\n") if ($debug);
print SSHOUT ("ARG3 = $rsync_argv[3]\n") if ($debug);
print SSHOUT ("ARG4 = $rsync_argv[4]\n") if ($debug);
print SSHOUT ("ARG5 = $rsync_argv[5]\n") if ($debug && $rsync_argv[2] eq '--sender');
# ARG[0] Complain if the command is not 'rsync'.
unless ($rsync_argv[0] =~ 'rsync') {
print SSHOUT ("ssh authorized_key account restricted: only rsync allowed\n");
$ok = $FALSE;
}
# ARG[1] Complain if this arg is not --server
unless ($rsync_argv[1] eq '--server') {
print SSHOUT ("ARG[1] <$rsync_argv[1]> Failure: this arg is not --server\n");
$ok = $FALSE;
}
# ARG[2] Check if this arg is --sender
applications/tools/templates/master/rsync-wrapper-failover-example.sh view on Meta::CPAN
if ( $rsync_version_2_6_7_or_higher ) {
print SSHOUT ("ARG5 = $rsync_argv[5]\n") if ($debug && $rsync_argv[2] eq '--sender');
} else {
print SSHOUT ("ARG5 = $rsync_argv[5]\n") if ($debug);
print SSHOUT ("ARG6 = $rsync_argv[6]\n") if ($debug);
print SSHOUT ("ARG7 = $rsync_argv[7]\n") if ($debug && $rsync_argv[2] eq '--sender');
}
# ARG[0] Complain if the command is not 'rsync'.
unless ($rsync_argv[0] =~ 'rsync') {
print SSHOUT ("ssh authorized_key account restricted: only rsync allowed\n");
$ok = $FALSE;
}
# ARG[1] Complain if this arg is not --server
unless ($rsync_argv[1] eq '--server') {
print SSHOUT ("ARG[1] <$rsync_argv[1]> Failure: this arg is not --server\n");
$ok = $FALSE;
}
# ARG[2] Check if this arg is --sender
applications/tools/templates/master/rsync-wrapper-failover-template.sh view on Meta::CPAN
if ( $rsync_version_2_6_7_or_higher ) {
print SSHOUT ("ARG5 = $rsync_argv[5]\n") if ($debug && $rsync_argv[2] eq '--sender');
} else {
print SSHOUT ("ARG5 = $rsync_argv[5]\n") if ($debug);
print SSHOUT ("ARG6 = $rsync_argv[6]\n") if ($debug);
print SSHOUT ("ARG7 = $rsync_argv[7]\n") if ($debug && $rsync_argv[2] eq '--sender');
}
# ARG[0] Complain if the command is not 'rsync'.
unless ($rsync_argv[0] =~ 'rsync') {
print SSHOUT ("ssh authorized_key account restricted: only rsync allowed\n");
$ok = $FALSE;
}
# ARG[1] Complain if this arg is not --server
unless ($rsync_argv[1] eq '--server') {
print SSHOUT ("ARG[1] <$rsync_argv[1]> Failure: this arg is not --server\n");
$ok = $FALSE;
}
# ARG[2] Check if this arg is --sender
applications/tools/templates/slave/rsync-mirror-distributed-example.sh view on Meta::CPAN
# vi /opt/asnmtap/applications/tools/templates/slave/rsync-mirror-failover-tmp.sh
# #!/bin/bash
# cd /opt/asnmtap/applications/tools/templates/slave/
# ./rsync-mirror-failover-example.sh -C rsync-mirror-failover-example.conf
# ------------------------------------------------------------------------------
# Shedule only one rsync-mirror-failover.sh scripts at the same time, unless you have more
# then one of 'rsync-wrapper-distributed.sh' script! When needed, copy 'rsync-wrapper-distributed.sh' to
# 'rsync-wrapper-distributed-02.sh', 'rsync-wrapper-distributed-05.sh', 'rsync-wrapper-distributed-10.sh'
# & 'rsync-wrapper-distributed-15.sh'
#
# authorized_keys -> command='/opt/asnmtap/applications/master/rsync-wrapper-distributed-02.sh' ...
# -> command='/opt/asnmtap/applications/master/rsync-wrapper-distributed-05.sh' ...
# -> command='/opt/asnmtap/applications/master/rsync-wrapper-distributed-10.sh' ...
# -> command='/opt/asnmtap/applications/master/rsync-wrapper-distributed-15.sh' ...
# ------------------------------------------------------------------------------
# vi hosts.allow
# rsync: <hostname slave failover servers>
#
# vi hosts.deny
# rsync: ALL
# ------------------------------------------------------------------------------
# Setup example:
#
# <slave server>:
# ssh-keygen -q -t rsa -f /home/asnmtap/.ssh/rsync -N ""
# or
# ssh-keygen -q -t dsa -f /home/asnmtap/.ssh/rsync -N ""
#
# chmod go-w /home/asnmtap/
# chmod 700 /home/asnmtap/.ssh
# chmod go-rwx /home/asnmtap/.ssh/*
# cat /home/asnmtap/.ssh/rsync.pub >> /home/asnmtap/.ssh/authorized_keys
# chmod 600 /home/asnmtap/.ssh/authorized_keys
#
# vi /usr/local/etc/sshd_config or /etc/ssh/sshd_config
# PubkeyAuthentication yes
# PermitEmptyPasswords yes
#
# <master server>:
# vi authorized_keys
# from="asnmtap.citap.be", command ="/opt/asnmtap/applications/master/rsync-wrapper-distributed-asnmtap.citap.com.sh" ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEA5o5rh/yScb8506oLJSPRaKR2PCKfI4U/YOSylN7h8w5z5jIO/6W7qKTwWyJ9lPF3c/D6WM2N4cVkVbcprJq+59vxEPCV9jmD...
# ^- rsync.pub
# Testing:
# /opt/asnmtap/applications/slave/rsync-mirror-failover-asnmtap.citap.be.sh
# ------------------------------------------------------------------------------
RMVersion='3.002.003'
echo "rsync-mirror-distributed version $RMVersion"
if [ -f ~/.profile ]; then
applications/tools/templates/slave/rsync-mirror-failover-example.sh view on Meta::CPAN
# vi /opt/asnmtap/applications/tools/templates/slave/rsync-mirror-failover-tmp.sh
# #!/bin/bash
# cd /opt/asnmtap/applications/tools/templates/slave/
# ./rsync-mirror-failover-example.sh -C rsync-mirror-failover-example.conf
# ------------------------------------------------------------------------------
# Shedule only one rsync-mirror-failover.sh scripts at the same time, unless you have more
# then one of 'rsync-wrapper-failover.sh' script! When needed, copy 'rsync-wrapper-failover.sh' to
# 'rsync-wrapper-failover-02.sh', 'rsync-wrapper-failover-05.sh', 'rsync-wrapper-failover-10.sh'
# & 'rsync-wrapper-failover-15.sh'
#
# authorized_keys -> command='/opt/asnmtap/applications/master/rsync-wrapper-failover-02.sh' ...
# -> command='/opt/asnmtap/applications/master/rsync-wrapper-failover-05.sh' ...
# -> command='/opt/asnmtap/applications/master/rsync-wrapper-failover-10.sh' ...
# -> command='/opt/asnmtap/applications/master/rsync-wrapper-failover-15.sh' ...
# ------------------------------------------------------------------------------
# vi hosts.allow
# rsync: <hostname slave failover servers>
#
# vi hosts.deny
# rsync: ALL
# ------------------------------------------------------------------------------
# Setup example:
#
# <slave server>:
# ssh-keygen -q -t rsa -f /home/asnmtap/.ssh/rsync -N ""
# or
# ssh-keygen -q -t dsa -f /home/asnmtap/.ssh/rsync -N ""
#
# chmod go-w /home/asnmtap/
# chmod 700 /home/asnmtap/.ssh
# chmod go-rwx /home/asnmtap/.ssh/*
# cat /home/asnmtap/.ssh/rsync.pub >> /home/asnmtap/.ssh/authorized_keys
# chmod 600 /home/asnmtap/.ssh/authorized_keys
#
# vi /usr/local/etc/sshd_config or /etc/ssh/sshd_config
# PubkeyAuthentication yes
# PermitEmptyPasswords yes
#
# <master server>:
# vi authorized_keys
# from="asnmtap.citap.be", command ="/opt/asnmtap/applications/master/rsync-wrapper-failover-asnmtap.citap.com.sh" ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEA5o5rh/yScb8506oLJSPRaKR2PCKfI4U/YOSylN7h8w5z5jIO/6W7qKTwWyJ9lPF3c/D6WM2N4cVkVbcprJq+59vxEPCV9jmDQjF...
# ^- rsync.pub
# Testing:
# /opt/asnmtap/applications/slave/rsync-mirror-failover-asnmtap.citap.be.sh
# ------------------------------------------------------------------------------
RMVersion='3.002.003'
echo "rsync-mirror-failover version $RMVersion"
if [ -f ~/.profile ]; then
etc/chatscripts/ASNMTAP view on Meta::CPAN
# This chatfile was generated by pppconfig 2.0.10.
# Please do not delete any of the comments. Pppconfig needs them.
#
# ispauth PAP
# abortstring
ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE' ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED
# modeminit
'' ATZ
# ispnumber
OK-AT-OK ATDT0070223326
# ispconnect
CONNECT \d\c
# prelogin
etc/ppp/peers/ASNMTAP view on Meta::CPAN
hide-password
noauth
noipdefault
remotename ASNMTAP
ipparam ASNMTAP
usepeerdns
lib/ASNMTAP/Asnmtap/Applications.pod view on Meta::CPAN
'remove $PIDPATH/CollectorCT-<daemon name>.pid'
'killall <pid>'
'../' are forbidden into a directory of filename for security reasons !!!
You need to create an ssh account:
ssh-keygen -t dsa -f /home/asnmtap/.ssh/asnmtap
vi /home/asnmtap/.ssh/authorized_keys
from="localhost", command="/opt/asnmtap/applications/sbin/sshWrapperASNMTAP.pl" ssh-dss AAAAB3Nza...+90k63Mx...3OmZOk= alex.peeters@citap.be
or with
from="localhost", command="ASNMTAP_PERL5LIB=/opt/asnmtap/cpan-shared/lib/perl5; /opt/asnmtap/applications/sbin/sshWrapperASNMTAP.pl" ssh-dss AAAAB3Nza...+90k63Mx...3OmZOk= alex.peeters@citap.be
vi hosts.allow
ssh: localhost
vi hosts.deny
ssh: ALL
lib/ASNMTAP/Asnmtap/Applications.pod view on Meta::CPAN
chmod go-w /home/asnmtap/
chmod 700 /home/asnmtap/.ssh
chmod go-rwx /home/asnmtap/.ssh/*
chmod 644 ssh.pub
chown asnmtap:asnmtap ssh.pub
chmod 600 ssh
chown apache:asnmtap ssh
cat /home/asnmtap/.ssh/ssh.pub >> /home/asnmtap/.ssh/authorized_keys
chmod 600 /home/asnmtap/.ssh/authorized_keys
vi /home/asnmtap/.ssh/authorized_keys
add command='/opt/asnmtap/applications/sbin/sshWrapperASNMTAP.pl' before ssh.pub
or
add command='ASNMTAP_PERL5LIB=/opt/asnmtap/cpan-shared/lib/perl5; /opt/asnmtap/applications/sbin/sshWrapperASNMTAP.pl' before ssh.pub
=back
=item Apache
=over 4
lib/ASNMTAP/Asnmtap/Plugins/Mail.pod view on Meta::CPAN
=item debug
debugging information
optional, scalar value, default: inherited from the parent object command line option -d or --debug
=back
=item _mailType
For clients that are sensitive to cookie-based authentication.
optional, mailType can be 0 or 1
0, TXT formated fingerprint (default)
1, XML formated fingerprint
=over 4
=item TXT