Merge remote-tracking branch 'origin/develop'

This commit is contained in:
artica 2021-06-10 17:13:42 +02:00
commit a11a948159
409 changed files with 92560 additions and 41605 deletions

2
.gitignore vendored
View File

@ -9,3 +9,5 @@ MYMETA.yml
**/PandoraFMS-Enterprise/pm_to_blib **/PandoraFMS-Enterprise/pm_to_blib
**/pandora_console/attachment/cache **/pandora_console/attachment/cache
**/pandora_console/attachment/agents **/pandora_console/attachment/agents
pandora_console/.DS_Store
.DS_Store

View File

@ -1,257 +1,252 @@
* {
font-family: "Open Sans", "Noto Sans", sans-serif
}
body { body {
min-width: 425px; min-width: 425px;
min-height: 540px; min-height: 540px;
margin: 5px; margin: 5px;
font-family: Tahoma, Geneva, Arial; font-size: 10pt;
font-size: 10pt;
} }
h1 { h1 {
font-weight: bold; font-weight: bold;
font-size: 14px; font-size: 14px;
margin: 2px 0px 2px 0px; margin: 2px 0px 2px 0px;
} }
h2 { h2 {
color : #333; color: #333;
} }
p { p {
font-size: 20px; font-size: 20px;
} }
a { a {
color: #254533; color: #254533;
text-decoration: none; text-decoration: none;
} }
a:hover { a:hover {
text-decoration: underline; text-decoration: underline;
} }
a:visited { a:visited {
color: #254533; text-decoration:none; color: #254533;
text-decoration: none;
} }
a:visited:hover { a:visited:hover {
text-decoration: underline; text-decoration: underline;
} }
span.res { span.res {
font-size: 80%; font-size: 80%;
color: #555; color: #555;
} }
img.pm { img.pm {
margin-right: 3px; margin-right: 3px;
cursor: pointer; cursor: pointer;
margin-top: 2px; margin-top: 2px;
float: right; float: right;
} }
div.main { div.main {
background-color: white; background-color: white;
height: 500px; height: 500px;
width: 400px; width: 400px;
} }
div.textarea { div.textarea {
background-color: #D5DED5; background-color: #d5ded5;
width: 100% width: 100%;
} }
div.e { div.e {
text-align: right; text-align: right;
font-size:8pt; font-size: 8pt;
} }
div.b { div.b {
background-color:white; background-color: white;
display: none; display: none;
} }
div.b p a { div.b p a {
font-size: 10pt; font-size: 10pt;
} }
div.b div.items p { div.b div.items p {
margin: 2px 0px 8px 0px; margin: 2px 0px 8px 0px;
width: 355px; width: 355px;
float: left; float: left;
display: block; display: block;
} }
div.b div.items p img { div.b div.items p img {
float: left; float: left;
margin: 0px 3px 0px 0px; margin: 0px 3px 0px 0px;
} }
div.options_header { div.options_header {
margin: 10px 10px; margin: 10px 10px;
} }
div.options_divider { div.options_divider {
width: 627px; width: 627px;
margin-top: 30px; margin-top: 30px;
} }
div.options_divider h2{ div.options_divider h2 {
margin: 20px 20px 0; margin: 20px 20px 0;
padding: 5px; padding: 5px;
font-weight: 500; border: 2px solid #82b92e;
border: 2px solid #82b92e; border-top-left-radius: 2px;
border-top-left-radius: 2px; border-top-right-radius: 2px;
border-top-right-radius: 2px; color: white;
color: white; text-align: center;
text-align: center; background: #82b92e;
background: #82b92e; font-size: 14px;
font-size: 14px; font-weight: 600;
font-weight: 600;
} }
div.options_textarea { div.options_textarea {
background-color: #f6f6f6; background-color: #f6f6f6;
width: 550px; width: 550px;
margin: 0 20px; margin: 0 20px;
padding: 10px 10px 25px 25px; padding: 10px 10px 25px 25px;
border-bottom-left-radius: 2px; border-bottom-left-radius: 2px;
border-bottom-right-radius: 2px; border-bottom-right-radius: 2px;
border: 1px solid #e4e4e4; border: 1px solid #e4e4e4;
border-top: 0; border-top: 0;
} }
div.options_footer { div.options_footer {
width: 550px; width: 550px;
margin: 10px 10px; margin: 10px 10px;
padding: 10px; padding: 10px;
} }
select { select {
background: white; background: white;
border: 1px solid #888; border: 1px solid #888;
font-size: smaller; font-size: smaller;
padding: 2px 1px; padding: 2px 1px;
width: 250px; width: 250px;
} }
.sound_selector td:first-child { .sound_selector td:first-child {
padding-left: 25px; padding-left: 25px;
width: 39%; width: 39%;
} }
.options_textarea button { .options_textarea button {
background-color: #82b92e; background-color: #82b92e;
border: 1px solid #82b92e; border: 1px solid #82b92e;
color: white; color: white;
padding: 6px 32px; padding: 6px 32px;
text-align: center; text-align: center;
text-decoration: none; text-decoration: none;
display: inline-block; display: inline-block;
font-size: 12px; font-size: 12px;
border-radius: 2px; border-radius: 2px;
margin: 25px 0px 0px 422px; margin: 25px 0px 0px 422px;
} }
.options_textarea button:hover { .options_textarea button:hover {
background-color: transparent; background-color: transparent;
color: #82b92e; color: #82b92e;
cursor: pointer; cursor: pointer;
} }
.options_textarea h3 { .options_textarea h3 {
text-align: left; text-align: left;
font-size: 11.4pt; font-size: 11.4pt;
} }
button h3 { button h3 {
margin: 0; margin: 0;
font-size: 10pt !important; font-size: 10pt !important;
} }
.tooltip { .tooltip {
display: none; display: none;
font-size: 12px; font-size: 12px;
height: 70px; height: 70px;
width: 160px; width: 160px;
padding: 25px; padding: 25px;
color: #eee; color: #eee;
} }
.spinner { .spinner {
position: fixed; position: fixed;
top: 50%; top: 50%;
left: 50%; left: 50%;
margin-left: -50px; margin-left: -50px;
margin-top: -50px; margin-top: -50px;
text-align: center; text-align: center;
z-index: 1234; z-index: 1234;
overflow: auto; overflow: auto;
width: 100px; width: 100px;
height: 102px; height: 102px;
} }
.error { .error {
display: flex; display: flex;
border: solid #e4e4e4 1px; border: solid #e4e4e4 1px;
border-radius: 2px; border-radius: 2px;
background: #f6f6f6; background: #f6f6f6;
padding: 10px; padding: 10px;
margin: 10px; margin: 10px;
margin-top: 35px; margin-top: 35px;
} }
.error_text { .error_text {
margin: 0 10px; margin: 0 10px;
} }
.result { .result {
margin: 10px; margin: 10px;
height: 500; height: 500;
overflow-y: auto; overflow-y: auto;
} }
#events_title { #events_title {
padding: 5px 0; padding: 5px 0;
margin: 0; margin: 0;
padding-bottom: 10px; padding-bottom: 10px;
border-bottom: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
} }
.event { .event {
border: solid 1px #e5e5e5; border: solid 1px #e5e5e5;
border-top: 0; border-top: 0;
padding: 5px 6px; padding: 5px 6px;
color: white; color: white;
} }
.event a { .event a {
margin-left: 5px; margin-left: 5px;
color: white; color: white;
font-size: 9pt; font-size: 9pt;
} }
.sev-Warning a { .sev-Warning a {
margin-left: 5px; margin-left: 5px;
color: #333; color: #333;
} }
.event p { .event p {
margin: 0 0 0 6px; margin: 0 0 0 6px;
padding-top: 2px; padding-top: 2px;
display: none; display: none;
font-size: 8pt; font-size: 8pt;
} }
.sev-Warning { .sev-Warning {
background: #FDDD30; background: #fddd30;
color: #333; color: #333;
} }
.sev-Critical { .sev-Critical {
background: #F84348; background: #f84348;
} }
.sev-Informational { .sev-Informational {
background: #4CA8E0; background: #4ca8e0;
} }
.sev-Normal { .sev-Normal {
background: #84B839; background: #84b839;
} }
.sev-Maintenance { .sev-Maintenance {
background: #A8A8A8; background: #a8a8a8;
} }
.sev-Minor { .sev-Minor {
background: #F099A2; background: #f099a2;
color: #333; color: #333;
} }
.sev-Major { .sev-Major {
background: #C97A4A; background: #c97a4a;
} }

View File

@ -1,22 +1,43 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en"> <html lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>Wicket Alert</title> <title>Wicket Alert</title>
<style type="text/css"> <style type="text/css">
body { margin:0; font-family:arial; font-size:10pt } body {
h1 { font-weight:bold; font-size:16px; margin:2px 0 2px 4px; color:#237948; font-family:arial; } margin: 0;
font-size: 10pt;
}
h1 {
font-weight: bold;
font-size: 16px;
margin: 2px 0 2px 4px;
color: #237948;
}
a { color: #237948; text-decoration:none; } a {
a:hover { text-decoration:underline; } color: #237948;
a:visited { color: #237948; text-decoration:none; } text-decoration: none;
a:visited:hover { text-decoration:underline; } }
</style> a:hover {
</head> text-decoration: underline;
<body> }
<h1>Event Alert</h1> a:visited {
<div id="e" style="background:url('images/icon.png') no-repeat 0% 50%; margin:0 4px; padding-left:50px; min-height:48px;"> color: #237948;
<script src="js/notification.js"></script> text-decoration: none;
</div> }
</body> a:visited:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<h1>Event Alert</h1>
<div
id="e"
style="background:url('images/icon.png') no-repeat 0% 50%; margin:0 4px; padding-left:50px; min-height:48px;"
>
<script src="js/notification.js"></script>
</div>
</body>
</html> </html>

View File

@ -254,6 +254,8 @@ server_dependencies=" \
perl(Geo::IP) \ perl(Geo::IP) \
perl(IO::Socket::INET6) \ perl(IO::Socket::INET6) \
perl(XML::Twig) \ perl(XML::Twig) \
expect \
openssh-clients \
http://firefly.artica.es/centos7/xprobe2-0.3-12.2.x86_64.rpm \ http://firefly.artica.es/centos7/xprobe2-0.3-12.2.x86_64.rpm \
http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm" http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm"
execute_cmd "yum install -y $server_dependencies" "Installing Pandora FMS Server dependencies" execute_cmd "yum install -y $server_dependencies" "Installing Pandora FMS Server dependencies"
@ -270,10 +272,10 @@ vmware_dependencies=" \
execute_cmd "yum install -y $vmware_dependencies" "Installing SDK VMware perl dependencies" execute_cmd "yum install -y $vmware_dependencies" "Installing SDK VMware perl dependencies"
# Instant client Oracle # Instant client Oracle
oracle_dependencier=" \ oracle_dependencies=" \
https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-basic-19.8.0.0.0-1.x86_64.rpm \ https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-basic-19.8.0.0.0-1.x86_64.rpm \
https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-sqlplus-19.8.0.0.0-1.x86_64.rpm" https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-sqlplus-19.8.0.0.0-1.x86_64.rpm"
execute_cmd "yum install -y $vmware_dependencies" "Installing Oracle Instant client" execute_cmd "yum install -y $oracle_dependencies" "Installing Oracle Instant client"
# Disabling SELINUX and firewalld # Disabling SELINUX and firewalld
setenforce 0 setenforce 0

View File

@ -11,7 +11,7 @@ RUN dnf install -y --setopt=tsflags=nodocs \
RUN dnf module reset -y php && dnf module install -y php:remi-7.3 RUN dnf module reset -y php && dnf module install -y php:remi-7.3
RUN dnf config-manager --set-enabled powertools RUN dnf config-manager --set-enabled powertools
# Install console # Install console dependencies
RUN dnf install -y --setopt=tsflags=nodocs \ RUN dnf install -y --setopt=tsflags=nodocs \
php \ php \
php-mcrypt \php-cli \ php-mcrypt \php-cli \
@ -91,9 +91,9 @@ RUN dnf install -y --setopt=tsflags=nodocs \
php-yaml php-yaml
RUN mkdir -p /run/php-fpm/ ; chown -R root:apache /run/php-fpm/ RUN mkdir -p /run/php-fpm/ ; chown -R root:apache /run/php-fpm/
# not installed perl-Net-Telnet gtk-update-icon-cach ghostscript-fonts # Not installed perl-Net-Telnet gtk-update-icon-cach ghostscript-fonts
# Install server # Install server dependencies
RUN dnf install -y --setopt=tsflags=nodocs \ RUN dnf install -y --setopt=tsflags=nodocs \
GeoIP \ GeoIP \
@ -256,16 +256,18 @@ RUN dnf install -y --setopt=tsflags=nodocs \
nmap \ nmap \
net-snmp-utils \ net-snmp-utils \
sudo \ sudo \
expect \
openssh-clients \
http://firefly.artica.es/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \ http://firefly.artica.es/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \
http://firefly.artica.es/centos8/wmi-1.3.14-4.el7.art.x86_64.rpm http://firefly.artica.es/centos7/wmic-1.4-1.el7.x86_64.rpm
# install utils # Install utils
RUN dnf install -y supervisor crontabs http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm --setopt=tsflags=nodocs RUN dnf install -y supervisor crontabs http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm --setopt=tsflags=nodocs
# SDK VMware perl dependencies # SDK VMware perl dependencies
RUN dnf install -y http://firefly.artica.es/centos8/perl-Crypt-OpenSSL-AES-0.02-1.el8.x86_64.rpm http://firefly.artica.es/centos8/perl-Crypt-SSLeay-0.73_07-1.gf.el8.x86_64.rpm perl-Net-HTTP perl-libwww-perl openssl-devel perl-Crypt-CBC perl-Bytes-Random-Secure perl-Crypt-Random-Seed perl-Math-Random-ISAAC perl-JSON http://firefly.artica.es/centos8/VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.rpm RUN dnf install -y http://firefly.artica.es/centos8/perl-Crypt-OpenSSL-AES-0.02-1.el8.x86_64.rpm http://firefly.artica.es/centos8/perl-Crypt-SSLeay-0.73_07-1.gf.el8.x86_64.rpm perl-Net-HTTP perl-libwww-perl openssl-devel perl-Crypt-CBC perl-Bytes-Random-Secure perl-Crypt-Random-Seed perl-Math-Random-ISAAC perl-JSON http://firefly.artica.es/centos8/VMware-vSphere-Perl-SDK-6.5.0-4566394.x86_64.rpm
# Instant client Oracle # Instant client Oracle
RUN dnf install -y https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-basic-19.8.0.0.0-1.x86_64.rpm https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-sqlplus-19.8.0.0.0-1.x86_64.rpm RUN dnf install -y https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-basic-19.8.0.0.0-1.x86_64.rpm https://download.oracle.com/otn_software/linux/instantclient/19800/oracle-instantclient19.8-sqlplus-19.8.0.0.0-1.x86_64.rpm
# Install Phantom
RUN dnf install -y supervisor crontabs http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm --setopt=tsflags=nodocs RUN dnf install -y supervisor crontabs http://firefly.artica.es/centos8/phantomjs-2.1.1-1.el7.x86_64.rpm --setopt=tsflags=nodocs

View File

@ -1,71 +1,116 @@
body { body {
min-width:425px; min-width: 425px;
min-height:540px; min-height: 540px;
margin:5px; margin: 5px;
font-family:Tahoma, Geneva, Arial; font-size: 10pt;
font-size:10pt;
} }
h1 { font-weight: bold; font-size:16px; margin:2px 0px 2px 0px; color:#237948; font-family:arial } h1 {
h2{ font-weight: bold;
color : blue; font-size: 16px;
margin: 2px 0px 2px 0px;
color: #237948;
}
h2 {
color: blue;
} }
label { color: #254533; text-decoration:none; } label {
label:hover { text-decoration:underline; } color: #254533;
label:visited { color: #254533; text-decoration:none; } text-decoration: none;
label:visited:hover { text-decoration:underline; }
label.text-link { color: #254533; text-decoration:none; }
label.text-link :hover { text-decoration:underline; }
label.text-link :visited { color: #254533; text-decoration:none; }
label.text-link :visited:hover { text-decoration:underline; }
span.res { font-size:80%; color:#555; }
image.pm { margin-right:3px;cursor:pointer; margin-top:0px; }
.main{
background-color : white;
height: 500px;
width: 400px;
} }
.textarea{ label:hover {
background-color : #D5DED5; text-decoration: underline;
width :100% }
label:visited {
color: #254533;
text-decoration: none;
}
label:visited:hover {
text-decoration: underline;
}
label.text-link {
color: #254533;
text-decoration: none;
}
label.text-link :hover {
text-decoration: underline;
}
label.text-link :visited {
color: #254533;
text-decoration: none;
}
label.text-link :visited:hover {
text-decoration: underline;
}
span.res {
font-size: 80%;
color: #555;
}
image.pm {
margin-right: 3px;
cursor: pointer;
margin-top: 0px;
}
.main {
background-color: white;
height: 500px;
width: 400px;
}
.textarea {
background-color: #d5ded5;
width: 100%;
}
vbox.e {
text-align: right;
font-size: 8pt;
}
vbox.b {
background-color: white;
border: 1px solid #bababa;
margin: 5px;
padding: 4px;
}
vbox.b description label {
font-size: 10pt;
}
vbox.b description {
margin: 2px 0px 4px 0px;
color: #333;
font-size: 9pt;
} }
vbox.e{ text-align:right; font-size:8pt; }
vbox.b { background-color:white; border:1px solid #BABABA; margin:5px; padding:4px; }
vbox.b description label { font-size: 10pt; }
vbox.b description { margin:2px 0px 4px 0px; color:#333; font-size:9pt; }
vbox.b vbox.items description { vbox.b vbox.items description {
margin:2px 0px 8px 0px; color:#333; width:355px;float:left; display:block; margin: 2px 0px 8px 0px;
color: #333;
width: 355px;
float: left;
display: block;
} }
vbox.b vbox.items description image { vbox.b vbox.items description image {
float:left;margin:0px 3px 0px 0px; float: left;
margin: 0px 3px 0px 0px;
} }
.tooltip { .tooltip {
display:none; display: none;
font-size:12px; font-size: 12px;
height:70px; height: 70px;
width:160px; width: 160px;
padding:25px; padding: 25px;
color:#eee; color: #eee;
} }
.spinner { .spinner {
position: fixed; position: fixed;
top: 50%; top: 50%;
left: 50%; left: 50%;
margin-left: -50px; /* half width of the spinner gif */ margin-left: -50px; /* half width of the spinner gif */
margin-top: -50px; /* half height of the spinner gif */ margin-top: -50px; /* half height of the spinner gif */
text-align:center; text-align: center;
z-index:1234; z-index: 1234;
overflow: auto; overflow: auto;
width: 100px; /* width of the spinner gif */ width: 100px; /* width of the spinner gif */
height: 102px; /*hight of the spinner gif +2px to fix IE8 issue */ height: 102px; /*hight of the spinner gif +2px to fix IE8 issue */
} }

View File

@ -160,9 +160,9 @@ echo "Updating Pandora Server version..."
sed -i -e "s/my\s\s*\$pandora_version\s*=.*/my \$pandora_version = \"$VERSION\";/" "$SERVER_FILE" sed -i -e "s/my\s\s*\$pandora_version\s*=.*/my \$pandora_version = \"$VERSION\";/" "$SERVER_FILE"
sed -i -e "s/my\s\s*\$pandora_build\s*=.*/my \$pandora_build = \"$BUILD\";/" "$SERVER_FILE" sed -i -e "s/my\s\s*\$pandora_build\s*=.*/my \$pandora_build = \"$BUILD\";/" "$SERVER_FILE"
echo "Updating DB maintenance script version..." echo "Updating DB maintenance script version..."
sed -i -e "s/my\s\s*\$version\s*=.*/my \$version = \"$VERSION PS$BUILD\";/" "$SERVER_DB_FILE" sed -i -e "s/my\s\s*\$version\s*=.*/my \$version = \"$VERSION Build $BUILD\";/" "$SERVER_DB_FILE"
echo "Updating CLI script version..." echo "Updating CLI script version..."
sed -i -e "s/my\s\s*\$version\s*=.*/my \$version = \"$VERSION PS$BUILD\";/" "$SERVER_CLI_FILE" sed -i -e "s/my\s\s*\$version\s*=.*/my \$version = \"$VERSION Build $BUILD\";/" "$SERVER_CLI_FILE"
sed -i -e "s/\s*\#\s*\Version.*/\# Version $VERSION/" "$SERVER_CONF_FILE" sed -i -e "s/\s*\#\s*\Version.*/\# Version $VERSION/" "$SERVER_CONF_FILE"
sed -i -e "s/\s*\!define PRODUCT_VERSION.*/\!define PRODUCT_VERSION \"$VERSION\"/" "$SERVER_WIN_MPI_OPEN_FILE" sed -i -e "s/\s*\!define PRODUCT_VERSION.*/\!define PRODUCT_VERSION \"$VERSION\"/" "$SERVER_WIN_MPI_OPEN_FILE"
sed -i -e "s/\s*\!define PRODUCT_VERSION.*/\!define PRODUCT_VERSION \"$VERSION\"/" "$SERVER_WIN_MPI_ENT_FILE" sed -i -e "s/\s*\!define PRODUCT_VERSION.*/\!define PRODUCT_VERSION \"$VERSION\"/" "$SERVER_WIN_MPI_ENT_FILE"
@ -197,7 +197,7 @@ echo "Updating Pandora Unix Agent version..."
sed -i -e "s/\s*use\s*constant\s*AGENT_VERSION =>.*/use constant AGENT_VERSION => '$VERSION';/" "$AGENT_UNIX_FILE" sed -i -e "s/\s*use\s*constant\s*AGENT_VERSION =>.*/use constant AGENT_VERSION => '$VERSION';/" "$AGENT_UNIX_FILE"
sed -i -e "s/\s*use\s*constant\s*AGENT_BUILD =>.*/use constant AGENT_BUILD => '$BUILD';/" "$AGENT_UNIX_FILE" sed -i -e "s/\s*use\s*constant\s*AGENT_BUILD =>.*/use constant AGENT_BUILD => '$BUILD';/" "$AGENT_UNIX_FILE"
echo "Updating Pandora Windows Agent version..." echo "Updating Pandora Windows Agent version..."
sed -i -e "s/\s*#define\s*PANDORA_VERSION\s*.*/#define PANDORA_VERSION (\"$VERSION(Build $BUILD)\")/" "$AGENT_WIN_FILE" sed -i -e "s/\s*#define\s*PANDORA_VERSION\s*.*/#define PANDORA_VERSION (\"$VERSION Build $BUILD\")/" "$AGENT_WIN_FILE"
sed -i -e "s/{Pandora FMS Windows Agent v.*}/{Pandora FMS Windows Agent v$VERSION}/" "$AGENT_WIN_MPI_FILE" sed -i -e "s/{Pandora FMS Windows Agent v.*}/{Pandora FMS Windows Agent v$VERSION}/" "$AGENT_WIN_MPI_FILE"
NUMERIC_VERSION=$(echo $VERSION | sed -e "s/\([0-9]*\.[0-9]*\).*/\1/") NUMERIC_VERSION=$(echo $VERSION | sed -e "s/\([0-9]*\.[0-9]*\).*/\1/")
sed -i -n "1h;1!H;\${;g;s/[\r\n]InstallVersion[\r\n]{\S*}/\nInstallVersion\n{$NUMERIC_VERSION.0.0}/g;p;}" "$AGENT_WIN_MPI_FILE" sed -i -n "1h;1!H;\${;g;s/[\r\n]InstallVersion[\r\n]{\S*}/\nInstallVersion\n{$NUMERIC_VERSION.0.0}/g;p;}" "$AGENT_WIN_MPI_FILE"

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.754, AIX version # Version 7.0NG.755, AIX version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.754, FreeBSD Version # Version 7.0NG.755, FreeBSD Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.754, HP-UX Version # Version 7.0NG.755, HP-UX Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.754, GNU/Linux # Version 7.0NG.755, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.754, GNU/Linux # Version 7.0NG.755, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.754, Solaris Version # Version 7.0NG.755, Solaris Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent # Base config file for Pandora FMS Windows Agent
# (c) 2006-2021 Artica Soluciones Tecnologicas # (c) 2006-2021 Artica Soluciones Tecnologicas
# Version 7.0NG.754 # Version 7.0NG.755
# This program is Free Software, you can redistribute it and/or modify it # This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software # under the terms of the GNU General Public Licence as published by the Free Software
# Foundation; either version 2 of the Licence or any later version # Foundation; either version 2 of the Licence or any later version

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.754, AIX version # Version 7.0NG.755, AIX version
# General Parameters # General Parameters
# ================== # ==================

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.754 # Version 7.0NG.755
# FreeBSD/IPSO version # FreeBSD/IPSO version
# Licenced under GPL licence, 2003-2007 Sancho Lerena # Licenced under GPL licence, 2003-2007 Sancho Lerena

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.754, HPUX Version # Version 7.0NG.755, HPUX Version
# General Parameters # General Parameters
# ================== # ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.754 # Version 7.0NG.755
# Licensed under GPL license v2, # Licensed under GPL license v2,
# (c) 2003-2021 Artica Soluciones Tecnologicas # (c) 2003-2021 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net # please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.754 # Version 7.0NG.755
# Licensed under GPL license v2, # Licensed under GPL license v2,
# (c) 2003-2021 Artica Soluciones Tecnologicas # (c) 2003-2021 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net # please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.754 # Version 7.0NG.755
# Licensed under GPL license v2, # Licensed under GPL license v2,
# please visit http://pandora.sourceforge.net # please visit http://pandora.sourceforge.net

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora # Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents # Base config file for Pandora agents
# Version 7.0NG.754, Solaris version # Version 7.0NG.755, Solaris version
# General Parameters # General Parameters
# ================== # ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.754, AIX version # Version 7.0NG.755, AIX version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.754-210430 Version: 7.0NG.755
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.754-210430" pandora_version="7.0NG.755"
echo "Test if you has the tools for to make the packages." echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -24,7 +24,7 @@ fi
if [ "$#" -ge 2 ]; then if [ "$#" -ge 2 ]; then
VERSION="$2" VERSION="$2"
else else
VERSION="7.0NG.754" VERSION="7.0NG.755"
fi fi
# Path for the generated DMG file # Path for the generated DMG file

View File

@ -19,11 +19,11 @@
<choice id="com.pandorafms.pandorafms_src" visible="false"> <choice id="com.pandorafms.pandorafms_src" visible="false">
<pkg-ref id="com.pandorafms.pandorafms_src"/> <pkg-ref id="com.pandorafms.pandorafms_src"/>
</choice> </choice>
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.754" onConclusion="none">pandorafms_src.pdk</pkg-ref> <pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.755" onConclusion="none">pandorafms_src.pdk</pkg-ref>
<choice id="com.pandorafms.pandorafms_uninstall" visible="true" customLocation="/Applications"> <choice id="com.pandorafms.pandorafms_uninstall" visible="true" customLocation="/Applications">
<pkg-ref id="com.pandorafms.pandorafms_uninstall"/> <pkg-ref id="com.pandorafms.pandorafms_uninstall"/>
</choice> </choice>
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.754" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref> <pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.755" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
<!-- <installation-check script="check()" /> <!-- <installation-check script="check()" />
<script> <script>
<![CDATA[ <![CDATA[

View File

@ -5,9 +5,9 @@
<key>CFBundleIconFile</key> <string>pandorafms.icns</string> <key>CFBundleIconFile</key> <string>pandorafms.icns</string>
<key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string> <key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string>
<key>CFBundleVersion</key> <string>7.0NG.754</string> <key>CFBundleVersion</key> <string>7.0NG.755</string>
<key>CFBundleGetInfoString</key> <string>7.0NG.754 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string> <key>CFBundleGetInfoString</key> <string>7.0NG.755 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
<key>CFBundleShortVersionString</key> <string>7.0NG.754</string> <key>CFBundleShortVersionString</key> <string>7.0NG.755</string>
<key>NSPrincipalClass</key><string>NSApplication</string> <key>NSPrincipalClass</key><string>NSApplication</string>
<key>NSMainNibFile</key><string>MainMenu</string> <key>NSMainNibFile</key><string>MainMenu</string>

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.754, GNU/Linux # Version 7.0NG.755, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.754, FreeBSD Version # Version 7.0NG.755, FreeBSD Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.754, HP-UX Version # Version 7.0NG.755, HP-UX Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.754, GNU/Linux # Version 7.0NG.755, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.754, GNU/Linux # Version 7.0NG.755, GNU/Linux
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.754, NetBSD Version # Version 7.0NG.755, NetBSD Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents # Base config file for Pandora FMS agents
# Version 7.0NG.754, Solaris Version # Version 7.0NG.755, Solaris Version
# Licensed under GPL license v2, # Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas # Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com # http://www.pandorafms.com

View File

@ -1014,8 +1014,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads # Semaphore used to control the number of threads
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.754'; use constant AGENT_VERSION => '7.0NG.755';
use constant AGENT_BUILD => '210430'; use constant AGENT_BUILD => '210610';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;
@ -1229,7 +1229,8 @@ use constant MAX_LOOP_COUNTER => 1000000000;
# Print usage information and exit. # Print usage information and exit.
################################################################################ ################################################################################
sub print_usage () { sub print_usage () {
print "\nUsage: $0 <Pandora home>\n\n"; print "Pandora FMS Agent for Linux v" . AGENT_VERSION . " Build " . AGENT_BUILD . "\n\n";
print "Usage: $0 <Pandora home>\n\n";
print "\tPandora home is the directory where pandora_agent.conf is located,\n"; print "\tPandora home is the directory where pandora_agent.conf is located,\n";
print "\tby default /etc/pandora.\n\n"; print "\tby default /etc/pandora.\n\n";
exit 1; exit 1;
@ -2330,9 +2331,6 @@ sub launch_tentacle_proxy () {
#Execute tentacle server as a daemon #Execute tentacle server as a daemon
my $new_process = "tentacle_server -a ".$Conf{'proxy_address'}." -p ".$Conf{'proxy_port'}." -b ".$Conf{'server_ip'}." -g ".$Conf{'server_port'}." -c ".$Conf{'proxy_max_connection'}." -t ".$Conf{'proxy_timeout'}; my $new_process = "tentacle_server -a ".$Conf{'proxy_address'}." -p ".$Conf{'proxy_port'}." -b ".$Conf{'server_ip'}." -g ".$Conf{'server_port'}." -c ".$Conf{'proxy_max_connection'}." -t ".$Conf{'proxy_timeout'};
$new_process .= ' -C' if ($Conf{'server_ssl'} eq '1');
log_message ('setup', 'Proxy mode enabled'); log_message ('setup', 'Proxy mode enabled');
exec ($new_process); exec ($new_process);
} }

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.754 %define version 7.0NG.755
%define release 210430 %define release 1
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent #Pandora FMS Linux Agent
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.754 %define version 7.0NG.755
%define release 210430 %define release 1
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -9,8 +9,8 @@
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license. # Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.754" PI_VERSION="7.0NG.755"
PI_BUILD="210430" PI_BUILD="210610"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0
@ -152,8 +152,8 @@ uninstall () {
fi fi
# Stops the agent on uninstall # Stops the agent on uninstall
if [ -f $PANDORA_BASE/etc/init.d/pandora_agent_daemon ]; then if [ -f /etc/init.d/pandora_agent_daemon ]; then
$PANDORA_BASE/etc/init.d/pandora_agent_daemon stop 12> /dev/null /etc/init.d/pandora_agent_daemon stop 12> /dev/null
else else
echo "$PANDORA_BASE/etc/init.d/pandora_agent_daemon not found to stop agent" echo "$PANDORA_BASE/etc/init.d/pandora_agent_daemon not found to stop agent"
fi fi

View File

@ -3,7 +3,7 @@
######################################################################## ########################################################################
# Pandora FMS - Remote Event Tool (via WEB API) # Pandora FMS - Remote Event Tool (via WEB API)
######################################################################## ########################################################################
# Copyright (c) 2013 Artica Soluciones Tecnologicas S.L # Copyright (c) 2021 Artica Soluciones Tecnologicas S.L
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 2 # modify it under the terms of the GNU General Public License version 2
@ -12,6 +12,7 @@
# Includes list # Includes list
use strict; use strict;
use LWP::Simple; use LWP::Simple;
use LWP::UserAgent;
use MIME::Base64; use MIME::Base64;
use lib '/usr/lib/perl5'; use lib '/usr/lib/perl5';
use PandoraFMS::Tools; use PandoraFMS::Tools;
@ -32,40 +33,41 @@ sub help_screen{
\t$0 -p <path_to_consoleAPI> -u <credentials> -create_event <options> \t$0 -p <path_to_consoleAPI> -u <credentials> -create_event <options>
Where options:\n Where options:\n
-u <credentials> : API credentials separated by comma: <api_pass>,<user>,<pass> -u <credentials> : API credentials separated by comma: <api_pass>,<user>,<pass>
-name <event_name> : Free text -name <event_name> : Free text (surrounded by single-quotes, for security reasons)
-group <id_group> : Group ID (use 0 for 'all') -group <id_group> : Group ID (use 0 for 'all')
-agent : Agent ID
Optional parameters: Optional parameters:
[-status <status>] : 0 New, 1 Validated, 2 In process [-agent <id_agent] : Agent ID
[-user <id_user>] : User comment (use in combination with -comment option) [-status <status>] : 0 New, 1 Validated, 2 In process
[-type <event_type>] : unknown, alert_fired, alert_recovered, alert_ceased [-user <id_user>] : User comment (use in combination with -comment option)
[-type <event_type>] : unknown, alert_fired, alert_recovered, alert_ceased
alert_manual_validation, system, error, new_agent alert_manual_validation, system, error, new_agent
configuration_change, going_unknown, going_down_critical, configuration_change, going_unknown, going_down_critical,
going_down_warning, going_up_normal going_down_warning, going_up_normal
[-severity <severity>] : 0 Maintance, [-severity <severity>] : 0 Maintance,
1 Informative, 1 Informative,
2 Normal, 2 Normal,
3 Warning, 3 Warning,
4 Crit, 4 Crit,
5 Minor, 5 Minor,
6 Major 6 Major
[-am <id_agent_module>] : ID Agent Module linked to event [-am <id_agent_module>] : ID Agent Module linked to event
[-alert <id_alert_am>] : ID Alert Module linked to event [-alert <id_alert_am>] : ID Alert Module linked to event
[-c_instructions <critical_instructions>] [-c_instructions <critical_instructions>]
[-w_instructions <warning_instructions>] [-w_instructions <warning_instructions>]
[-u_instructions <unknown_instructions>] [-u_instructions <unknown_instructions>]
[-user_comment <comment>] [-user_comment <comment>] : Free text (surrounded by single-quotes, for security reasons)
[-owner_user <owner event>] : Use the login name, not the descriptive [-owner_user <owner event>] : Use the login name, not the descriptive
[-source <source>] : (By default 'Pandora') [-source <source>] : (By default 'Pandora')
[-tag <tags>] : Tag (must exist in the system to be imported) [-tag <tags>] : Tag (must exist in the system to be imported)
[-custom_data <custom_data>]: Custom data has to be in JSON format. Example: -custom_data \'{\"test1\" : \"t1\", \"test2\": \"2\"}\' [-custom_data <custom_data>]: Custom data has to be in JSON format. Example: -custom_data \'{\"test1\" : \"t1\", \"test2\": \"2\"}\'
[-id_extra <id extra>] : Id extra [-id_extra <id extra>] : Id extra
[-agent_name <Agent name>] : Agent name, Not to be confused with the alias. [-agent_name <Agent name>] : Agent name, Not to be confused with the alias.
[-force_create_agent<0 o 1>]: Force the creation of agent through an event this will create when it is 1. [-force_create_agent<0 o 1>] : Force the creation of agent through an event this will create when it is 1.
[-server_id <server_id>] : The pandora node server_id\n\n"; [-separator '<char/s>'] : If you use the vertical bar `|` in the event name, you must set other character for send the info. This must be surrounded by single-quotes
[-server_id <server_id>] : The pandora node server_id\n\n";
print "Example of event generation:\n\n"; print "Example of event generation:\n\n";
@ -88,7 +90,7 @@ Optional parameters:
############################################################################## ##############################################################################
sub tool_api_init () { sub tool_api_init () {
print "\nPandora FMS Remote Event Tool Copyright (c) 2013-2015 Artica ST\n"; print "\nPandora FMS Remote Event Tool Copyright (c) 2013-2021 Artica ST\n";
print "This program is Free Software, licensed under the terms of GPL License v2\n"; print "This program is Free Software, licensed under the terms of GPL License v2\n";
print "You can download latest versions and documentation at http://www.pandorafms.org\n\n"; print "You can download latest versions and documentation at http://www.pandorafms.org\n\n";
@ -120,7 +122,7 @@ sub tool_api_main () {
my $db_user; my $db_user;
my $db_pass; my $db_pass;
my @db_info; my @db_info;
my $id_agent; my $id_agent = '0';
my $id_user = ''; my $id_user = '';
my $status = ''; my $status = '';
my $id_agent_module = ''; my $id_agent_module = '';
@ -141,6 +143,7 @@ sub tool_api_main () {
my $call_api; my $call_api;
my $custom_data = ""; my $custom_data = "";
my $server_id = 0; my $server_id = 0;
my $separator = '|';
#~ help or api path (required) #~ help or api path (required)
if ($ARGV[0] eq '-h') { if ($ARGV[0] eq '-h') {
@ -185,12 +188,18 @@ sub tool_api_main () {
if ($line eq '-agent') { if ($line eq '-agent') {
$id_agent = $ARGV[$i + 1]; $id_agent = $ARGV[$i + 1];
# If not defined, send 0 for API.
if ($id_agent eq undef) {
$id_agent = '0';
}
} }
if ($line eq '-group') { if ($line eq '-group') {
$id_group = $ARGV[$i + 1]; $id_group = $ARGV[$i + 1];
} }
if ($line eq '-name') { if ($line eq '-name') {
$event_name = $ARGV[$i + 1]; $event_name = $ARGV[$i + 1];
$event_name =~ s/#/%23/g;
} }
if ($line eq '-type') { if ($line eq '-type') {
$event_type = $ARGV[$i + 1]; $event_type = $ARGV[$i + 1];
@ -250,50 +259,49 @@ sub tool_api_main () {
if ($line eq '-server_id') { if ($line eq '-server_id') {
$server_id = $ARGV[$i + 1]; $server_id = $ARGV[$i + 1];
} }
if ($line eq '-separator') {
$separator = $ARGV[$i + 1];
}
$i++; $i++;
} }
if ($event_name eq "") { if ($event_name eq "") {
print "[ERROR] Missing id agent! Read help info:\n\n"; print "[ERROR] Missing event name! Read help info:\n\n";
help_screen (); help_screen ();
} }
if ($id_group eq "") { if ($id_group eq "") {
print "[ERROR] Missing event group! Read help info:\n\n"; print "[ERROR] Missing event group! Read help info:\n\n";
help_screen (); help_screen ();
} }
if ($id_agent eq "" && $agent_name eq "") {
print "[ERROR] Missing id agent! and agent_name Read help info:\n\n";
help_screen ();
}
$data_event = $event_name . $data_event = $event_name .
"|" . $id_group . $separator . $id_group .
"|" . $id_agent . $separator . $id_agent .
"|" . $status . $separator . $status .
"|" . $id_user . $separator . $id_user .
"|" . $event_type . $separator . $event_type .
"|" . $severity . $separator . $severity .
"|" . $id_agent_module . $separator . $id_agent_module .
"|" . $id_alert_am . $separator . $id_alert_am .
"|" . $critical_instructions . $separator . $critical_instructions .
"|" . $warning_instructions . $separator . $warning_instructions .
"|" . $unknown_instructions . $separator . $unknown_instructions .
"|" . $user_comment . $separator . $user_comment .
"|" . $owner_user . $separator . $owner_user .
"|" . $source . $separator . $source .
"|" . $tags . $separator . $tags .
"|" . $custom_data . $separator . $custom_data .
"|" . $server_id . $separator . $server_id .
"|" . $id_extra . $separator . $id_extra .
"|" . $agent_name . $separator . $agent_name .
"|" . $force_create_agent; $separator . $force_create_agent;
$call_api = $api_path . '?' . $call_api = $api_path . '?' .
'op=set&' . 'op=set&' .
'op2=create_event&' . 'op2=create_event&' .
'other=' . $data_event .'&' . 'other=' . $data_event .'&' .
'other_mode=url_encode_separator_|&' . 'other_mode=url_encode_separator_'.$separator.'&' .
'apipass=' . $api_pass . '&' . 'apipass=' . $api_pass . '&' .
'user=' . $db_user . '&' . 'user=' . $db_user . '&' .
'pass=' . $db_pass; 'pass=' . $db_pass;
@ -321,7 +329,8 @@ sub tool_api_main () {
exit; exit;
} }
else { else {
my $content = get($call_api); my $ua = LWP::UserAgent->new(ssl_opts => { verify_hostname => 0 });
my $content = $ua->get($call_api);
if ($option eq '-create_event') { if ($option eq '-create_event') {
if ($content eq undef) { if ($content eq undef) {
@ -329,7 +338,7 @@ sub tool_api_main () {
help_screen(); help_screen();
} }
else { else {
print "Event ID: $content"; print "Event ID: $content->{'_content'}";
} }
} }
elsif ($option eq '-validate_event') { elsif ($option eq '-validate_event') {

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent # Base config file for Pandora FMS Windows Agent
# (c) 2006-2021 Artica Soluciones Tecnologicas # (c) 2006-2021 Artica Soluciones Tecnologicas
# Version 7.0NG.754 # Version 7.0NG.755
# This program is Free Software, you can redistribute it and/or modify it # This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software # under the terms of the GNU General Public Licence as published by the Free Software
# Foundation; either version 2 of the Licence or any later version # Foundation; either version 2 of the Licence or any later version

View File

@ -3,7 +3,7 @@ AllowLanguageSelection
{Yes} {Yes}
AppName AppName
{Pandora FMS Windows Agent v7.0NG.754} {Pandora FMS Windows Agent v7.0NG.755}
ApplicationID ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F} {17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{210430} {210610}
ViewReadme ViewReadme
{Yes} {Yes}
@ -2387,7 +2387,7 @@ Windows,BuildSeparateArchives
{No} {No}
Windows,Executable Windows,Executable
{<%AppName%>-<%Version%>-Setup<%Ext%>} {<%AppName%>-Setup<%Ext%>}
Windows,FileDescription Windows,FileDescription
{<%AppName%> <%Version%> Setup} {<%AppName%> <%Version%> Setup}

View File

@ -115,8 +115,8 @@ main (int argc, char *argv[]) {
return 0; return 0;
} else if (_stricmp(argv[i], HELP_CMDLINE_PARAM) == 0) { } else if (_stricmp(argv[i], HELP_CMDLINE_PARAM) == 0) {
/* Help parameter */ /* Help parameter */
cout << "Pandora agent for Windows. "; cout << "Pandora agent for Windows ";
cout << "Version " << getPandoraAgentVersion () << endl; cout << "v" << getPandoraAgentVersion () << endl << endl;
cout << "Usage: " << argv[0] << " [OPTION]" << endl << endl; cout << "Usage: " << argv[0] << " [OPTION]" << endl << endl;
cout << "Available options are:" << endl; cout << "Available options are:" << endl;
cout << "\t" << SERVICE_INSTALL_CMDLINE_PARAM; cout << "\t" << SERVICE_INSTALL_CMDLINE_PARAM;

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils; using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1 #define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.754(Build 210430)") #define PANDORA_VERSION ("7.0NG.755 Build 210610")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

@ -423,7 +423,7 @@ Pandora_Windows_Service::killTentacleProxy() {
int int
Pandora_Windows_Service::launchTentacleProxy() { Pandora_Windows_Service::launchTentacleProxy() {
string server_ip, server_port, proxy_max_connections, proxy_timeout, server_ssl; string server_ip, server_port, proxy_max_connections, proxy_timeout;
string proxy_cmd, proxy_address, proxy_port; string proxy_cmd, proxy_address, proxy_port;
PROCESS_INFORMATION pi; PROCESS_INFORMATION pi;
STARTUPINFO si; STARTUPINFO si;
@ -451,15 +451,6 @@ Pandora_Windows_Service::launchTentacleProxy() {
server_port = "41121"; server_port = "41121";
} }
server_ssl = conf->getValue("server_ssl");
if (server_ssl == "1") {
proxy_cmd = "tentacle_server.exe -C";
}
else {
proxy_cmd = "tentacle_server.exe";
}
// Proxy address. // Proxy address.
proxy_address = conf->getValue("proxy_address"); proxy_address = conf->getValue("proxy_address");
if (proxy_address == "") { if (proxy_address == "") {
@ -472,7 +463,7 @@ Pandora_Windows_Service::launchTentacleProxy() {
proxy_port = "41121"; proxy_port = "41121";
} }
proxy_cmd += " -b " + server_ip + " -g " + server_port + " -c " + proxy_max_connections + " -t " + proxy_timeout + " -a " + proxy_address + " -p " + proxy_port; proxy_cmd = "tentacle_server.exe -b " + server_ip + " -g " + server_port + " -c " + proxy_max_connections + " -t " + proxy_timeout + " -a " + proxy_address + " -p " + proxy_port;
ZeroMemory (&si, sizeof (si)); ZeroMemory (&si, sizeof (si));
ZeroMemory (&pi, sizeof (pi)); ZeroMemory (&pi, sizeof (pi));

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST" VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent" VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.754(Build 210430))" VALUE "ProductVersion", "(7.0NG.755(Build 210610))"
VALUE "FileVersion", "1.0.0.0" VALUE "FileVersion", "1.0.0.0"
END END
END END

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.754-210430 Version: 7.0NG.755
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.754-210430" pandora_version="7.0NG.755"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -31,18 +31,18 @@ require 'vendor/autoload.php';
define('AJAX', true); define('AJAX', true);
if (!defined('__PAN_XHPROF__')) { if (defined('__PAN_XHPROF__') === false) {
define('__PAN_XHPROF__', 0); define('__PAN_XHPROF__', 0);
} }
if (__PAN_XHPROF__ === 1) { if (__PAN_XHPROF__ === 1) {
if (function_exists('tideways_xhprof_enable')) { if (function_exists('tideways_xhprof_enable') === true) {
tideways_xhprof_enable(); tideways_xhprof_enable();
} }
} }
if ((! file_exists('include/config.php')) if (file_exists('include/config.php') === false
|| (! is_readable('include/config.php')) || is_readable('include/config.php') === false
) { ) {
exit; exit;
} }
@ -57,11 +57,11 @@ require_once 'include/auth/mysql.php';
if (isset($config['console_log_enabled']) === true if (isset($config['console_log_enabled']) === true
&& $config['console_log_enabled'] == 1 && $config['console_log_enabled'] == 1
) { ) {
ini_set('log_errors', 1); ini_set('log_errors', true);
ini_set('error_log', $config['homedir'].'/log/console.log'); ini_set('error_log', $config['homedir'].'/log/console.log');
} else { } else {
ini_set('log_errors', 0); ini_set('log_errors', false);
ini_set('error_log', null); ini_set('error_log', '');
} }
// Sometimes input is badly retrieved from caller... // Sometimes input is badly retrieved from caller...
@ -98,9 +98,11 @@ if (isset($_GET['loginhash']) === true) {
} }
} }
// Another auth class example: PandoraFMS\Dashboard\Manager.
$auth_class = io_safe_output( $auth_class = io_safe_output(
get_parameter('auth_class', 'PandoraFMS\Dashboard\Manager') get_parameter('auth_class', 'PandoraFMS\User')
); );
$public_hash = get_parameter('auth_hash', false); $public_hash = get_parameter('auth_hash', false);
$public_login = false; $public_login = false;
// Check user. // Check user.
@ -124,7 +126,7 @@ if (class_exists($auth_class) === false || $public_hash === false) {
ob_start(); ob_start();
// Enterprise support. // Enterprise support.
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) { if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php') === true) {
include_once ENTERPRISE_DIR.'/load_enterprise.php'; include_once ENTERPRISE_DIR.'/load_enterprise.php';
} }
@ -142,12 +144,12 @@ if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
); );
} }
if (is_metaconsole()) { if (is_metaconsole() === true) {
// Backward compatibility. // Backward compatibility.
define('METACONSOLE', true); define('METACONSOLE', true);
} }
if (file_exists($page)) { if (file_exists($page) === true) {
include_once $page; include_once $page;
} else { } else {
echo '<br /><b class="error">Sorry! I can\'t find the page '.$page.'!</b>'; echo '<br /><b class="error">Sorry! I can\'t find the page '.$page.'!</b>';
@ -172,7 +174,7 @@ if (isset($config['force_instant_logout']) === true
header_remove('Set-Cookie'); header_remove('Set-Cookie');
setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/'); setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/');
if ($config['auth'] == 'saml') { if ($config['auth'] === 'saml') {
include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php'; include_once $config['saml_path'].'simplesamlphp/lib/_autoload.php';
$as = new SimpleSAML_Auth_Simple('PandoraFMS'); $as = new SimpleSAML_Auth_Simple('PandoraFMS');
$as->logout(); $as->logout();

View File

@ -1,16 +1,29 @@
<?php <?php
/** /**
* Pandora FMS - http://pandorafms.com * Agents/Modules Monitoring view.
* ================================================== *
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas * @category Operations
* Please see http://pandorafms.org for full contribution list * @package Pandora FMS
* This program is free software; you can redistribute it and/or * @subpackage Opensource
* modify it under the terms of the GNU General Public License * @version 1.0.0
* as published by the Free Software Foundation; version 2 * @license See below
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of * ______ ___ _______ _______ ________
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* GNU General Public License for more details. * | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/ */
// Begin. // Begin.
@ -370,7 +383,7 @@ function mainAgentsModules()
&full_agents_id='.$full_agents.'&selection_agent_module='.$selection_a_m.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).'</a>'; &full_agents_id='.$full_agents.'&selection_agent_module='.$selection_a_m.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).'</a>';
} else { } else {
$fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_modules&amp;pure=1&amp; $fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&amp;sec=extensions&amp;sec2=extensions/agents_modules&amp;pure=1&amp;
offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode')]).'</a>'; offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).'</a>';
} }
} }
@ -435,14 +448,25 @@ function mainAgentsModules()
if ($config['pure'] == 0) { if ($config['pure'] == 0) {
// Header. // Header.
ui_print_page_header( ui_print_standard_header(
__('Agents/Modules'), __('Agents/Modules'),
'images/module.png', 'images/module.png',
false, false,
'', '',
false, false,
$updated_time (array) $updated_time,
[
[
'link' => '',
'label' => __('Monitoring'),
],
[
'link' => '',
'label' => __('Views'),
],
]
); );
echo '<table class="w100p">'; echo '<table class="w100p">';
echo '<tr>'; echo '<tr>';
echo "<td> <span class='float-right'>".$fullscreen['text'].'</span> </td>'; echo "<td> <span class='float-right'>".$fullscreen['text'].'</span> </td>';

View File

@ -103,7 +103,7 @@ function load_matrix_console()
context.fillRect(0, 0, width, height); context.fillRect(0, 0, width, height);
context.fillStyle = "#0F0"; // Green text context.fillStyle = "#0F0"; // Green text
context.font = font_size + "px arial"; context.font = font_size + "px lato";
// Looping over drops // Looping over drops
for (var i = 0; i < drops.length; i++) { for (var i = 0; i < drops.length; i++) {
if (drops[i] == -1) { if (drops[i] == -1) {

View File

@ -246,13 +246,24 @@ function mainModuleGroups()
$array_data[$value['id_grupo']][$value['id_mg']] = $value; $array_data[$value['id_grupo']][$value['id_mg']] = $value;
} }
ui_print_page_header( // Header.
ui_print_standard_header(
__('Combined table of agent group and module group'), __('Combined table of agent group and module group'),
'images/module_group.png', 'images/module_group.png',
false, false,
'', '',
false, false,
'' [],
[
[
'link' => '',
'label' => __('Monitoring'),
],
[
'link' => '',
'label' => __('Views'),
],
]
); );
echo "<table cellpadding='4' cellspacing='4' class='databox filters bolder margin-bottom-10' width='100%'> echo "<table cellpadding='4' cellspacing='4' class='databox filters bolder margin-bottom-10' width='100%'>

View File

@ -42,6 +42,10 @@ function pandora_realtime_graphs()
global $config; global $config;
check_login(); check_login();
if ($config['style'] === 'pandora_black') {
ui_require_css_file('pandora_black', 'include/styles/', true);
}
$id_network = get_parameter('id_network', 0); $id_network = get_parameter('id_network', 0);
$action = get_parameter('action', 'list'); $action = get_parameter('action', 'list');
@ -49,13 +53,24 @@ function pandora_realtime_graphs()
$hide_header = get_parameter('hide_header', 0); $hide_header = get_parameter('hide_header', 0);
if ($hide_header === 0) { if ($hide_header === 0) {
ui_print_page_header( // Header.
ui_print_standard_header(
__('Realtime graphs'), __('Realtime graphs'),
'images/extensions.png', 'images/extensions.png',
false, false,
'real_time_view', 'real_time_view',
false, false,
$onheader $onheader,
[
[
'link' => '',
'label' => __('Monitoring'),
],
[
'link' => '',
'label' => __('Views'),
],
]
); );
} }
@ -66,8 +81,8 @@ function pandora_realtime_graphs()
$long_index = []; $long_index = [];
$no_data_image = ''; $no_data_image = '';
$canvas = '<div id="graph_container">'; $canvas = '<div id="graph_container" class="graph_container">';
$canvas .= '<div id="chartLegend"></div>'; $canvas .= '<div id="chartLegend" class="chartLegend"></div>';
$width = 800; $width = 800;
$height = 300; $height = 300;
@ -239,7 +254,9 @@ function pandora_realtime_graphs()
echo '<script type="text/javascript" src="'.ui_get_full_url('include/javascript/pandora_snmp_browser.js').'"></script>'; echo '<script type="text/javascript" src="'.ui_get_full_url('include/javascript/pandora_snmp_browser.js').'"></script>';
echo '<script type="text/javascript" src="'.ui_get_full_url('extensions/realtime_graphs/realtime_graphs.js').'"></script>'; echo '<script type="text/javascript" src="'.ui_get_full_url('extensions/realtime_graphs/realtime_graphs.js').'"></script>';
echo '<link rel="stylesheet" type="text/css" href="'.ui_get_full_url('extensions/realtime_graphs/realtime_graphs.css').'"></style>'; if ($config['style'] !== 'pandora_black') {
echo '<link rel="stylesheet" type="text/css" href="'.ui_get_full_url('extensions/realtime_graphs/realtime_graphs.css').'"></style>';
}
// Store servers timezone offset to be retrieved from js. // Store servers timezone offset to be retrieved from js.
set_js_value('timezone_offset', date('Z', time())); set_js_value('timezone_offset', date('Z', time()));

View File

@ -1,29 +1,43 @@
<?php <?php
/**
* Resource registration.
*
* @category Extensions
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com /**
// ================================================== * Remember the hard-coded values.
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas * -- id_modulo now uses tmodule.
// Please see http://pandorafms.org for full contribution list * -- ---------------------------.
// This program is free software; you can redistribute it and/or * -- 1 - Data server modules (agent related modules)
// modify it under the terms of the GNU General Public License * -- 2 - Network server modules
// as published by the Free Software Foundation; version 2 * -- 4 - Plugin server
// This program is distributed in the hope that it will be useful, * -- 5 - Predictive server
// but WITHOUT ANY WARRANTY; without even the implied warranty of * -- 6 - WMI server
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -- 7 - WEB Server (enteprise)
// GNU General Public License for more details. * In the xml is the tag "module_source"
// Remember the hard-coded values */
/*
-- id_modulo now uses tmodule
-- ---------------------------
-- 1 - Data server modules (agent related modules)
-- 2 - Network server modules
-- 4 - Plugin server
-- 5 - Predictive server
-- 6 - WMI server
-- 7 - WEB Server (enteprise)
In the xml is the tag "module_source"
*/
require_once $config['homedir'].'/include/functions_agents.php'; require_once $config['homedir'].'/include/functions_agents.php';
enterprise_include_once('include/functions_local_components.php'); enterprise_include_once('include/functions_local_components.php');
@ -1096,6 +1110,7 @@ function resource_registration_extension_main()
} }
$xml = simplexml_load_file($_FILES['resource_upload']['tmp_name'], null, LIBXML_NOCDATA); $xml = simplexml_load_file($_FILES['resource_upload']['tmp_name'], null, LIBXML_NOCDATA);
if ($xml === false) { if ($xml === false) {
ui_print_error_message( ui_print_error_message(
__('Error uploading resource. Check if the selected file is a valid resource template in .ptr format') __('Error uploading resource. Check if the selected file is a valid resource template in .ptr format')

View File

@ -74,7 +74,12 @@ enterprise/extensions/ipam
enterprise/extensions/disabled/visual_console_manager.php enterprise/extensions/disabled/visual_console_manager.php
enterprise/extensions/visual_console_manager.php enterprise/extensions/visual_console_manager.php
pandora_console/extensions/net_tools.php pandora_console/extensions/net_tools.php
enterprise/godmode/agentes/module_manager_editor_web.php
enterprise/include/ajax/web_server_module_debug.php
enterprise/include/class/WebServerModuleDebug.class.php
enterprise/include/styles/WebServerModuleDebug.css
include/lib/WSManager.php include/lib/WSManager.php
include/lib/WebSocketServer.php include/lib/WebSocketServer.php
include/lib/WebSocketUser.php include/lib/WebSocketUser.php
operation/network/network_explorer.php operation/network/network_explorer.php
operation/vsual_console/pure_ajax.php

View File

@ -0,0 +1,27 @@
START TRANSACTION;
ALTER TABLE `tusuario` ADD COLUMN `integria_user_level_user` VARCHAR(60);
ALTER TABLE `tusuario` ADD COLUMN `integria_user_level_pass` VARCHAR(45);
ALTER TABLE `tperfil` DROP COLUMN `incident_view`;
ALTER TABLE `tperfil` DROP COLUMN `incident_edit`;
ALTER TABLE `tperfil` DROP COLUMN `incident_management`;
ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field16` TEXT NOT NULL AFTER `al_field15`;
ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field17` TEXT NOT NULL AFTER `al_field16`;
ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field18` TEXT NOT NULL AFTER `al_field17`;
ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field19` TEXT NOT NULL AFTER `al_field18`;
ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field20` TEXT NOT NULL AFTER `al_field19`;
SET @st_oum755 = (SELECT IF(
(SELECT COUNT(*) FROM tconfig WHERE token LIKE 'meta_custom_logo' AND value like 'logo_pandora_metaconsola.png') > 0,
"UPDATE `tconfig` set value = 'pandoraFMS_metaconsole_full.svg' WHERE token LIKE 'meta_custom_logo'",
"SELECT 1"
));
PREPARE pr_oum755 FROM @st_oum755;
EXECUTE pr_oum755;
DEALLOCATE PREPARE pr_oum755;
UPDATE `tconfig` set value = 'lato.ttf' WHERE token LIKE 'custom_report_front_font';
UPDATE `tconfig` set value = 'lato.ttf' WHERE token LIKE 'fontpath';
COMMIT;

View File

@ -1019,7 +1019,7 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event` (
-- Criticity: 5 - Minor -- Criticity: 5 - Minor
-- Criticity: 6 - Major -- Criticity: 6 - Major
ALTER TABLE `tmetaconsole_event` ADD COLUMN `data` double(22,5) default NULL; ALTER TABLE `tmetaconsole_event` ADD COLUMN `data` double(50,5) default NULL;
ALTER TABLE `tmetaconsole_event` ADD COLUMN `module_status` int(4) NOT NULL default '0'; ALTER TABLE `tmetaconsole_event` ADD COLUMN `module_status` int(4) NOT NULL default '0';
ALTER TABLE `tmetaconsole_event` ADD INDEX `server_id` (`server_id`); ALTER TABLE `tmetaconsole_event` ADD INDEX `server_id` (`server_id`);
ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_timestamp_idx` (`timestamp`); ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_timestamp_idx` (`timestamp`);
@ -1072,7 +1072,7 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event_history` (
-- Criticity: 5 - Minor -- Criticity: 5 - Minor
-- Criticity: 6 - Major -- Criticity: 6 - Major
ALTER TABLE `tmetaconsole_event_history` ADD COLUMN `data` double(22,5) default NULL; ALTER TABLE `tmetaconsole_event_history` ADD COLUMN `data` double(50,5) default NULL;
ALTER TABLE `tmetaconsole_event_history` ADD COLUMN `module_status` int(4) NOT NULL default '0'; ALTER TABLE `tmetaconsole_event_history` ADD COLUMN `module_status` int(4) NOT NULL default '0';
ALTER TABLE `tmetaconsole_event_history` ADD INDEX `tmeh_estado_idx` (`estado`); ALTER TABLE `tmetaconsole_event_history` ADD INDEX `tmeh_estado_idx` (`estado`);
ALTER TABLE `tmetaconsole_event_history` ADD INDEX `tmeh_timestamp_idx` (`timestamp`); ALTER TABLE `tmetaconsole_event_history` ADD INDEX `tmeh_timestamp_idx` (`timestamp`);
@ -1334,6 +1334,11 @@ ALTER TABLE talert_snmp_action ADD COLUMN `al_field12` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_snmp_action ADD COLUMN `al_field13` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_snmp_action ADD COLUMN `al_field13` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_snmp_action ADD COLUMN `al_field14` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_snmp_action ADD COLUMN `al_field14` TEXT NOT NULL DEFAULT "";
ALTER TABLE talert_snmp_action ADD COLUMN `al_field15` TEXT NOT NULL DEFAULT ""; ALTER TABLE talert_snmp_action ADD COLUMN `al_field15` TEXT NOT NULL DEFAULT "";
ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field16` TEXT NOT NULL AFTER `al_field15`;
ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field17` TEXT NOT NULL AFTER `al_field16`;
ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field18` TEXT NOT NULL AFTER `al_field17`;
ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field19` TEXT NOT NULL AFTER `al_field18`;
ALTER TABLE `talert_snmp_action` ADD COLUMN `al_field20` TEXT NOT NULL AFTER `al_field19`;
-- ---------------------------------------------------------------------- -- ----------------------------------------------------------------------
-- Table `tserver` -- Table `tserver`
@ -1527,6 +1532,8 @@ ALTER TABLE `tusuario` MODIFY COLUMN `default_event_filter` int(10) unsigned NOT
ADD CONSTRAINT `fk_filter_id` FOREIGN KEY `fk_filter_id` (`id_filter`) REFERENCES `tevent_filter` (`id_filter`) ON DELETE SET NULL ON UPDATE RESTRICT, ADD CONSTRAINT `fk_filter_id` FOREIGN KEY `fk_filter_id` (`id_filter`) REFERENCES `tevent_filter` (`id_filter`) ON DELETE SET NULL ON UPDATE RESTRICT,
DROP FOREIGN KEY `fk_id_filter`, DROP FOREIGN KEY `fk_id_filter`,
DROP INDEX `fk_id_filter`; DROP INDEX `fk_id_filter`;
ALTER TABLE `tusuario` ADD COLUMN `integria_user_level_user` VARCHAR(60);
ALTER TABLE `tusuario` ADD COLUMN `integria_user_level_pass` VARCHAR(45);
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
@ -1549,7 +1556,7 @@ ALTER TABLE `tagente_modulo` ADD COLUMN `debug_content` varchar(200);
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tagente_datos` -- Table `tagente_datos`
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
ALTER TABLE tagente_datos MODIFY `datos` double(22,5); ALTER TABLE tagente_datos MODIFY `datos` double(50,5);
ALTER TABLE `tagente_datos` DROP INDEX `data_index1`, ADD INDEX `data_index1` (`id_agente_modulo`, `utimestamp`); ALTER TABLE `tagente_datos` DROP INDEX `data_index1`, ADD INDEX `data_index1` (`id_agente_modulo`, `utimestamp`);
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
@ -1560,7 +1567,7 @@ ALTER TABLE `tagente_datos_string` MODIFY COLUMN `datos` mediumtext NOT NULL, DR
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tagente_datos_inc` -- Table `tagente_datos_inc`
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
ALTER TABLE tagente_datos_inc MODIFY `datos` double(22,5); ALTER TABLE tagente_datos_inc MODIFY `datos` double(50,5);
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tnetwork_component` -- Table `tnetwork_component`
@ -2334,7 +2341,7 @@ CREATE TABLE IF NOT EXISTS `tagent_custom_fields_filter` (
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tevento` -- Table `tevento`
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
ALTER TABLE `tevento` ADD COLUMN `data` double(22,5) default NULL; ALTER TABLE `tevento` ADD COLUMN `data` double(50,5) default NULL;
ALTER TABLE `tevento` ADD COLUMN `module_status` int(4) NOT NULL default '0'; ALTER TABLE `tevento` ADD COLUMN `module_status` int(4) NOT NULL default '0';
@ -4025,3 +4032,6 @@ DELETE FROM `tconfig` WHERE `token` = 'ipam_installed';
DELETE FROM `tconfig` WHERE `token` = 'ipam_recon_script_id'; DELETE FROM `tconfig` WHERE `token` = 'ipam_recon_script_id';
ALTER TABLE `tperfil` DROP COLUMN `incident_view`;
ALTER TABLE `tperfil` DROP COLUMN `incident_edit`;
ALTER TABLE `tperfil` DROP COLUMN `incident_management`;

View File

@ -192,15 +192,15 @@ if (check_login()) {
echo " echo "
</div> </div>
<div class='right height_30px'> <div class='btn_update_online_open height_30px'>
</div>
<div class='modalokbutton cerrar'> <div class='modalokbutton cerrar'>
<span class='modalokbuttontext'>OK</span> <span class='modalokbuttontext'>OK</span>
</div>"; </div>";
if ($open) { if ($open) {
echo "<div class='modalgobutton gopandora'> echo "<div class='modalgobutton gopandora'>
<span class='modalgobuttontext'>About Enterprise</span> <span class='modalgobuttontext'>About Enterprise</span>
</div>"; </div></div>";
} }
} }

View File

@ -24,12 +24,20 @@ if (! check_acl($config['id_user'], 0, 'AR') && ! check_acl($config['id_user'],
return; return;
} }
\ui_print_page_header( // Header.
__('Monitoring').' &raquo; '.__('Clusters'), ui_print_standard_header(
__('Clusters'),
'images/chart.png', 'images/chart.png',
false, false,
'', '',
false false,
[],
[
[
'link' => '',
'label' => __('Monitoring'),
],
]
); );
ui_require_css_file('first_task'); ui_require_css_file('first_task');

View File

@ -15,14 +15,14 @@ global $config;
check_login(); check_login();
ui_require_css_file('first_task'); ui_require_css_file('first_task');
?> ?>
<?php ui_print_info_message(['no_close' => true, 'message' => __('There are no planned downtime defined yet.') ]); ?> <?php ui_print_info_message(['no_close' => true, 'message' => __('There are no scheduled downtime defined yet.') ]); ?>
<div class="new_task"> <div class="new_task">
<div class="image_task"> <div class="image_task">
<?php echo html_print_image('images/first_task/icono_grande_visualconsole.png', true, ['title' => __('Planned Downtime')]); ?> <?php echo html_print_image('images/first_task/icono_grande_visualconsole.png', true, ['title' => __('Scehduled Downtime')]); ?>
</div> </div>
<div class="text_task"> <div class="text_task">
<h3> <?php echo __('Create Planned Downtime'); ?></h3><p id="description_task"> <h3> <?php echo __('Create Scheduled Downtime'); ?></h3><p id="description_task">
<?php <?php
echo __( echo __(
"%s contains a scheduled downtime management system. "%s contains a scheduled downtime management system.
@ -34,7 +34,7 @@ ui_require_css_file('first_task');
?> ?>
</p> </p>
<form action="index.php?sec=extensions&amp;sec2=godmode/agentes/planned_downtime.editor" method="post"> <form action="index.php?sec=extensions&amp;sec2=godmode/agentes/planned_downtime.editor" method="post">
<input type="submit" class="button_task" value="<?php echo __('Create Planned Downtime'); ?>" /> <input type="submit" class="button_task" value="<?php echo __('Create Scheduled Downtime'); ?>" />
</form> </form>
</div> </div>
</div> </div>

View File

@ -31,7 +31,7 @@ if (!$config['MR']) {
$config['MR'] = 0; $config['MR'] = 0;
} }
echo '<a class="footer" target="_blank" href="'.$config['homeurl'].$license_file.'">'; echo '<a class="footer"target="_blank" href="'.$config['homeurl'].$license_file.'">';
require_once $config['homedir'].'/include/functions_update_manager.php'; require_once $config['homedir'].'/include/functions_update_manager.php';
@ -49,9 +49,7 @@ echo __(
$pandora_version, $pandora_version,
$build_package_version, $build_package_version,
$config['MR'] $config['MR']
); ).'</a><br><span>'.__('Page generated on %s', date('Y-m-d H:i:s')).'</span><br>';
echo '</a><br />';
echo '<small><span>'.__('Page generated on %s', date('Y-m-d H:i:s')).'</span></small>';

View File

@ -88,7 +88,6 @@ if (check_acl($config['id_user'], 0, 'AW')
|| check_acl($config['id_user'], 0, 'LM') || check_acl($config['id_user'], 0, 'LM')
|| check_acl($config['id_user'], 0, 'UM') || check_acl($config['id_user'], 0, 'UM')
|| check_acl($config['id_user'], 0, 'LW') || check_acl($config['id_user'], 0, 'LW')
|| check_acl($config['id_user'], 0, 'IW')
|| check_acl($config['id_user'], 0, 'EW') || check_acl($config['id_user'], 0, 'EW')
|| check_acl($config['id_user'], 0, 'DW') || check_acl($config['id_user'], 0, 'DW')
) { ) {

View File

@ -28,7 +28,6 @@
.modalheadertex{ .modalheadertex{
color:white; color:white;
position:relative; position:relative;
font-family:Nunito;
font-size:13pt; font-size:13pt;
top:8px; top:8px;
} }
@ -70,7 +69,6 @@
} }
.modalwikibuttontex{ .modalwikibuttontex{
color:#ffffff; color:#ffffff;
font-family:Nunito;
font-size:10pt; font-size:10pt;
position:relative; position:relative;
top:6px; top:6px;

View File

@ -29,7 +29,6 @@
} }
.modalheadertex{ .modalheadertex{
color:#000; color:#000;
font-family:Nunito;
line-height: 40px; line-height: 40px;
font-size: 23pt; font-size: 23pt;
margin-bottom:30px; margin-bottom:30px;
@ -66,7 +65,6 @@
} }
.modalokbuttontex{ .modalokbuttontex{
color:#82b92e; color:#82b92e;
font-family:Nunito;
font-size:13pt; font-size:13pt;
} }
.modalgobutto{ .modalgobutto{
@ -80,7 +78,6 @@
} }
.modalgobuttontex{ .modalgobuttontex{
color:#82b92e; color:#82b92e;
font-family:Nunito;
font-size:10pt; font-size:10pt;
} }

View File

@ -29,7 +29,6 @@
} }
.modalheadertex{ .modalheadertex{
color:#000; color:#000;
font-family:Nunito;
line-height: 40px; line-height: 40px;
font-size: 23pt; font-size: 23pt;
margin-bottom:30px; margin-bottom:30px;
@ -66,7 +65,6 @@
} }
.modalokbuttontex{ .modalokbuttontex{
color:#82b92e; color:#82b92e;
font-family:Nunito;
font-size:13pt; font-size:13pt;
} }
.modalgobutto{ .modalgobutto{
@ -80,7 +78,6 @@
} }
.modalgobuttontex{ .modalgobuttontex{
color:#82b92e; color:#82b92e;
font-family:Nunito;
font-size:10pt; font-size:10pt;
} }

View File

@ -39,7 +39,7 @@ $offset = (int) get_parameter('offset', 0);
// See if id_agente is set (either POST or GET, otherwise -1 // See if id_agente is set (either POST or GET, otherwise -1
$id_agent = (int) get_parameter('id_agente'); $id_agent = (int) get_parameter('id_agente');
$groups = users_get_groups($config['id_user'], 'IR'); $groups = users_get_groups($config['id_user'], 'AR');
$filter = ' AND id_agent = '.$id_agent; $filter = ' AND id_agent = '.$id_agent;
$url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=incident&id_agente='.$id_agent; $url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=incident&id_agente='.$id_agent;
@ -55,7 +55,7 @@ $params = [
agents_get_name($id_agent), agents_get_name($id_agent),
]; ];
$result = integria_api_call($config['integria_hostname'], $config['integria_user'], $config['integria_pass'], $config['integria_api_pass'], 'get_incidents', $params, false, 'json', ','); $result = integria_api_call(null, null, null, null, 'get_incidents', $params, false, 'json', ',');
$result = json_decode($result, true); $result = json_decode($result, true);

View File

@ -500,7 +500,7 @@ if (enterprise_installed()) {
false, false,
// Delete_groups. // Delete_groups.
// Do not show the primary group in this selection. // Do not show the primary group in this selection.
array_merge($secondary_groups_selected['plain'], [$agent['id_grupo']]) array_merge(($secondary_groups_selected['plain'] ?? []), [$agent['id_grupo']])
// Include_groups. // Include_groups.
// Size. // Size.
// Simple_multiple_options. // Simple_multiple_options.
@ -1004,9 +1004,9 @@ echo '<div class="action-buttons agent_manager" style="width: '.$table->width.'"
// The context help about the learning mode. // The context help about the learning mode.
if ($modo == 0) { if ($modo == 0) {
echo "<span id='modules_not_learning_mode_context_help pdd_r_10px' '>"; echo "<span id='modules_not_learning_mode_context_help' class='pdd_r_10px'>";
} else { } else {
echo "<span id='modules_not_learning_mode_context_help invisible'>"; echo "<span id='modules_not_learning_mode_context_help' class='invisible'>";
} }
echo clippy_context_help('modules_not_learning_mode'); echo clippy_context_help('modules_not_learning_mode');

View File

@ -1668,47 +1668,30 @@ if ($update_module) {
'module_macros' => $module_macros, 'module_macros' => $module_macros,
]; ];
if (preg_match('/http_auth_user/m', $values['plugin_parameter'])) {
$http_user_conf = true;
}
if (preg_match('/http_auth_pass/m', $values['plugin_parameter'])) { if ($id_module_type == 30 || $id_module_type == 31 || $id_module_type == 32 || $id_module_type == 33) {
$http_pass_conf = true; $plugin_parameter_split = explode('&#x0a;', $values['plugin_parameter']);
}
$values['plugin_parameter'] = '';
if (!$http_user_conf || !$http_pass_conf) { foreach ($plugin_parameter_split as $key => $value) {
if ($id_module_type == 30 || $id_module_type == 31 || $id_module_type == 32 || $id_module_type == 33) { if ($key == 1) {
$plugin_parameter_split = explode('&#x0a;', $values['plugin_parameter']); if ($http_user) {
$values['plugin_parameter'] .= 'http_auth_user&#x20;'.$http_user.'&#x0a;';
$values['plugin_parameter'] = '';
foreach ($plugin_parameter_split as $key => $value) {
if ($key == 1) {
if ($http_user) {
if ($http_user_conf) {
continue;
}
$values['plugin_parameter'] .= 'http_auth_user&#x20;'.$http_user.'&#x0a;';
}
if ($http_pass) {
if ($http_user_pass) {
continue;
}
$values['plugin_parameter'] .= 'http_auth_pass&#x20;'.$http_pass.'&#x0a;';
}
$values['plugin_parameter'] .= $value.'&#x0a;';
} else {
$values['plugin_parameter'] .= $value.'&#x0a;';
} }
if ($http_pass) {
$values['plugin_parameter'] .= 'http_auth_pass&#x20;'.$http_pass.'&#x0a;';
}
$values['plugin_parameter'] .= $value.'&#x0a;';
} else {
$values['plugin_parameter'] .= $value.'&#x0a;';
} }
} }
} }
// In local modules, the interval is updated by agent. // In local modules, the interval is updated by agent.
$module_kind = (int) get_parameter('moduletype'); $module_kind = (int) get_parameter('moduletype');
if ($module_kind == MODULE_DATA) { if ($module_kind == MODULE_DATA) {
@ -2112,106 +2095,8 @@ if ($delete_module) {
exit; exit;
} }
enterprise_include_once('include/functions_config_agents.php'); // Also call base function to delete modules madafakas de los cojones.
enterprise_hook('config_agents_delete_module_in_conf', [modules_get_agentmodule_agent($id_borrar_modulo), modules_get_agentmodule_name($id_borrar_modulo)]); modules_delete_agent_module($id_borrar_modulo);
// Init transaction.
$error = 0;
// First delete from tagente_modulo -> if not successful, increment
// error. NOTICE that we don't delete all data here, just marking for deletion
// and delete some simple data.
$values = [
'nombre' => 'pendingdelete',
'disabled' => 1,
'delete_pending' => 1,
];
$result = db_process_sql_update(
'tagente_modulo',
$values,
['id_agente_modulo' => $id_borrar_modulo]
);
if ($result === false) {
$error++;
} else {
// Set flag to update module status count.
db_process_sql(
'UPDATE tagente
SET update_module_count = 1, update_alert_count = 1
WHERE id_agente = '.$module_data['id_agente']
);
}
$result = db_process_sql_delete(
'tagente_estado',
['id_agente_modulo' => $id_borrar_modulo]
);
if ($result === false) {
$error++;
}
$result = db_process_sql_delete(
'tagente_datos_inc',
['id_agente_modulo' => $id_borrar_modulo]
);
if ($result === false) {
$error++;
}
if (alerts_delete_alert_agent_module(
false,
['id_agent_module' => $id_borrar_modulo]
) === false
) {
$error++;
}
$result = db_process_delete_temp(
'ttag_module',
'id_agente_modulo',
$id_borrar_modulo
);
if ($result === false) {
$error++;
}
// Trick to detect if we are deleting a synthetic module (avg or arithmetic)
// If result is empty then module doesn't have this type of submodules.
$ops_json = enterprise_hook('modules_get_synthetic_operations', [$id_borrar_modulo]);
$result_ops_synthetic = json_decode($ops_json);
if (!empty($result_ops_synthetic)) {
$result = enterprise_hook('modules_delete_synthetic_operations', [$id_borrar_modulo]);
if ($result === false) {
$error++;
}
} else {
$result_components = enterprise_hook('modules_get_synthetic_components', [$id_borrar_modulo]);
$count_components = 1;
if (!empty($result_components)) {
// Get number of components pending to delete to know when it's needed to update orders.
$num_components = count($result_components);
$last_target_module = 0;
foreach ($result_components as $id_target_module) {
// Detects change of component or last component to update orders.
if (($count_components == $num_components)
|| ($last_target_module != $id_target_module)
) {
$update_orders = true;
} else {
$update_orders = false;
}
$result = enterprise_hook('modules_delete_synthetic_operations', [$id_target_module, $id_borrar_modulo, $update_orders]);
if ($result === false) {
$error++;
}
$count_components++;
$last_target_module = $id_target_module;
}
}
}
// Check for errors. // Check for errors.
if ($error != 0) { if ($error != 0) {

View File

@ -1,17 +1,32 @@
<?php <?php
/**
* Agents defined view.
*
* @category Manage Agents.
* @package Pandora FMS
* @subpackage Resources.
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com // Begin.
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
check_login(); check_login();
// Take some parameters (GET). // Take some parameters (GET).
@ -76,13 +91,23 @@ $viewtab['active'] = false;
$onheader = ['view' => $viewtab]; $onheader = ['view' => $viewtab];
// Header. // Header.
ui_print_page_header( ui_print_standard_header(
__('Agents defined in %s', get_product_name()), __('Agents defined in %s', get_product_name()),
'images/agent.png', 'images/agent.png',
false, false,
'', '',
true, true,
$onheader $onheader,
[
[
'link' => '',
'label' => __('Resources'),
],
[
'link' => '',
'label' => __('Manage agents'),
],
]
); );
if (is_central_policies_on_node()) { if (is_central_policies_on_node()) {
@ -746,9 +771,9 @@ if ($agents !== false) {
if ($in_planned_downtime) { if ($in_planned_downtime) {
ui_print_help_tip( ui_print_help_tip(
__('Agent in planned downtime'), __('Agent in scheduled downtime'),
false, false,
$config['image']['minireloj_16'] 'images/minireloj-16.png'
); );
echo '</em>'; echo '</em>';

View File

@ -1,22 +1,38 @@
<?php <?php
/**
* Module Manager main script.
*
* @category Module
* @package Pandora FMS
* @subpackage Agent Configuration
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com // You can redefine $url and unset $id_agente to reuse the form. Dirty (hope temporal) hack.
// ================================================== $url_id_agente = (isset($id_agente) === true) ? '&id_agente='.$id_agente : '';
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list $url = sprintf(
// This program is free software; you can redistribute it and/or 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module%s',
// modify it under the terms of the GNU General Public License $url_id_agente
// as published by the Free Software Foundation for version 2. );
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You can redefine $url and unset $id_agente to reuse the form. Dirty (hope temporal) hack
if (isset($id_agente)) {
$url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$id_agente;
} else {
$url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module';
}
enterprise_include('godmode/agentes/module_manager.php'); enterprise_include('godmode/agentes/module_manager.php');
$isFunctionPolicies = enterprise_include_once('include/functions_policies.php'); $isFunctionPolicies = enterprise_include_once('include/functions_policies.php');
@ -56,7 +72,7 @@ echo __('Search').' '.html_print_input_text(
); );
html_print_input_hidden('search', 1); html_print_input_hidden('search', 1);
// Search string filter form. // Search string filter form.
if (($policy_page) || (isset($agent))) { if (($policy_page !== false) || (isset($agent) === true)) {
echo '<form id="" method="post" action="">'; echo '<form id="" method="post" action="">';
} else { } else {
echo '<form id="create_module_type" method="post" action="'.$url.'">'; echo '<form id="create_module_type" method="post" action="'.$url.'">';
@ -73,25 +89,31 @@ echo '</form>';
$network_available = db_get_sql( $network_available = db_get_sql(
'SELECT count(*) 'SELECT count(*)
FROM tserver FROM tserver
WHERE server_type = 1' WHERE server_type = '.SERVER_TYPE_NETWORK
); );
// POSTGRESQL AND ORACLE COMPATIBLE. // POSTGRESQL AND ORACLE COMPATIBLE.
$wmi_available = db_get_sql( $wmi_available = db_get_sql(
'SELECT count(*) 'SELECT count(*)
FROM tserver FROM tserver
WHERE server_type = 6' WHERE server_type = '.SERVER_TYPE_WMI
); );
// POSTGRESQL AND ORACLE COMPATIBLE. // POSTGRESQL AND ORACLE COMPATIBLE.
$plugin_available = db_get_sql( $plugin_available = db_get_sql(
'SELECT count(*) 'SELECT count(*)
FROM tserver FROM tserver
WHERE server_type = 4' WHERE server_type = '.SERVER_TYPE_PLUGIN
); );
// POSTGRESQL AND ORACLE COMPATIBLE. // POSTGRESQL AND ORACLE COMPATIBLE.
$prediction_available = db_get_sql( $prediction_available = db_get_sql(
'SELECT count(*) 'SELECT count(*)
FROM tserver FROM tserver
WHERE server_type = 5' WHERE server_type = '.SERVER_TYPE_PREDICTION
);
// POSTGRESQL AND ORACLE COMPATIBLE.
$web_available = db_get_sql(
'SELECT count(*)
FROM tserver
WHERE server_type = '.SERVER_TYPE_WEB
); );
// POSTGRESQL AND ORACLE COMPATIBLE. // POSTGRESQL AND ORACLE COMPATIBLE.
// Development mode to use all servers. // Development mode to use all servers.
@ -122,6 +144,10 @@ if ($prediction_available) {
$modules['predictionserver'] = __('Create a new prediction server module'); $modules['predictionserver'] = __('Create a new prediction server module');
} }
if ($web_available) {
$modules['webserver'] = __('Create a new web Server module');
}
if (enterprise_installed()) { if (enterprise_installed()) {
set_enterprise_module_types($modules); set_enterprise_module_types($modules);
} }
@ -212,7 +238,7 @@ echo '</table>';
if (!$config['disable_help']) { if (!$config['disable_help']) {
echo '<div class="disable_help">'; echo '<div class="disable_help">';
echo '<strong>'; echo '<strong>';
echo "<a class='color-black-grey' target='_blank' href='http://pandorafms.com/Library/Library/'>".__('Get more modules on Monitoring Library').'</a>'; echo "<a class='color-black-grey invert_filter' target='_blank' href='http://pandorafms.com/Library/Library/'>".__('Get more modules on Monitoring Library').'</a>';
echo '</strong>'; echo '</strong>';
echo '</div>'; echo '</div>';
} }
@ -298,6 +324,7 @@ if ($module_action === 'delete') {
switch ($config['dbtype']) { switch ($config['dbtype']) {
case 'mysql': case 'mysql':
case 'postgresql': case 'postgresql':
default:
$result = db_process_sql_delete( $result = db_process_sql_delete(
'tagente_estado', 'tagente_estado',
['id_agente_modulo' => $id_agent_module_del] ['id_agente_modulo' => $id_agent_module_del]
@ -388,10 +415,8 @@ if ($module_action === 'delete') {
} }
} }
// Check for errors. // Check for errors.
if ($error != 0) { if ((int) $error == 0) {
} else {
$count_correct_delete_modules++; $count_correct_delete_modules++;
} }
} }
@ -489,6 +514,7 @@ switch ($sortField) {
switch ($config['dbtype']) { switch ($config['dbtype']) {
case 'mysql': case 'mysql':
case 'postgresql': case 'postgresql':
default:
$order[] = [ $order[] = [
'field' => 'tagente_modulo.nombre', 'field' => 'tagente_modulo.nombre',
'order' => 'ASC', 'order' => 'ASC',
@ -509,6 +535,7 @@ switch ($sortField) {
switch ($config['dbtype']) { switch ($config['dbtype']) {
case 'mysql': case 'mysql':
case 'postgresql': case 'postgresql':
default:
$order[] = [ $order[] = [
'field' => 'tagente_modulo.nombre', 'field' => 'tagente_modulo.nombre',
'order' => 'DESC', 'order' => 'DESC',
@ -523,6 +550,10 @@ switch ($sortField) {
break; break;
} }
break; break;
default:
// Do none.
break;
} }
break; break;
@ -543,6 +574,10 @@ switch ($sortField) {
'order' => 'DESC', 'order' => 'DESC',
]; ];
break; break;
default:
// Do none.
break;
} }
break; break;
@ -563,6 +598,10 @@ switch ($sortField) {
'order' => 'DESC', 'order' => 'DESC',
]; ];
break; break;
default:
// Do none.
break;
} }
break; break;
@ -583,6 +622,10 @@ switch ($sortField) {
'order' => 'DESC', 'order' => 'DESC',
]; ];
break; break;
default:
// Do none.
break;
} }
break; break;
@ -598,6 +641,7 @@ switch ($sortField) {
switch ($config['dbtype']) { switch ($config['dbtype']) {
case 'mysql': case 'mysql':
case 'postgresql': case 'postgresql':
default:
$order[] = [ $order[] = [
'field' => 'nombre', 'field' => 'nombre',
'order' => 'ASC', 'order' => 'ASC',
@ -622,7 +666,7 @@ if (!empty($order)) {
$first = true; $first = true;
foreach ($order as $ord) { foreach ($order as $ord) {
if ($first) { if ($first === true) {
$first = false; $first = false;
} else { } else {
$order_sql .= ','; $order_sql .= ',';
@ -635,31 +679,35 @@ foreach ($order as $ord) {
$limit = (int) $config['block_size']; $limit = (int) $config['block_size'];
$offset = (int) get_parameter('offset'); $offset = (int) get_parameter('offset');
$params = ($checked) ? 'tagente_modulo.*, tmodule_group.*' : implode( if ((bool) $checked === true) {
',', $params = 'tagente_modulo.*, tmodule_group.*';
[ } else {
'tagente_modulo.id_agente_modulo', $params = implode(
'id_tipo_modulo', ',',
'descripcion', [
'nombre', 'tagente_modulo.id_agente_modulo',
'max', 'id_tipo_modulo',
'min', 'descripcion',
'module_interval', 'nombre',
'id_modulo', 'max',
'id_module_group', 'min',
'disabled', 'module_interval',
'max_warning', 'id_modulo',
'min_warning', 'id_module_group',
'str_warning', 'disabled',
'max_critical', 'max_warning',
'min_critical', 'min_warning',
'str_critical', 'str_warning',
'quiet', 'max_critical',
'critical_inverse', 'min_critical',
'warning_inverse', 'str_critical',
'id_policy_module', 'quiet',
] 'critical_inverse',
); 'warning_inverse',
'id_policy_module',
]
);
}
$where = sprintf('delete_pending = 0 AND id_agente = %s', $id_agente); $where = sprintf('delete_pending = 0 AND id_agente = %s', $id_agente);
@ -686,7 +734,11 @@ if (isset($config['paginate_module'])) {
if ($paginate_module) { if ($paginate_module) {
if (!isset($limit_sql)) { if (!isset($limit_sql)) {
$limit_sql = " LIMIT $offset, $limit "; $limit_sql = sprintf(
'LIMIT %s, %s',
$offset,
$limit
);
} }
} else { } else {
$limit_sql = ''; $limit_sql = '';
@ -732,7 +784,13 @@ if ($modules === false) {
} }
// Prepare pagination. // Prepare pagination.
$url = '?'.'sec=gagente&'.'tab=module&'.'sec2=godmode/agentes/configurar_agente&'.'id_agente='.$id_agente.'&'.'sort_field='.$sortField.'&'.'&sort='.$sort.'&'.'search_string='.urlencode($search_string); $url = sprintf(
'?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&id_agente=%s&sort_field=%s&sort=%s&search_string=%s',
$id_agente,
$sortField,
$sort,
urlencode($search_string)
);
if ($paginate_module) { if ($paginate_module) {
ui_pagination($total_modules, $url); ui_pagination($total_modules, $url);
@ -1072,7 +1130,6 @@ foreach ($modules as $module) {
[ [
'alt' => __('Enable module'), 'alt' => __('Enable module'),
'title' => __('Enable module'), 'title' => __('Enable module'),
'class' => 'invert_filter_important',
] ]
).'</a>'; ).'</a>';
} else { } else {

View File

@ -682,6 +682,22 @@ switch ($moduletype) {
include 'module_manager_editor_wmi.php'; include 'module_manager_editor_wmi.php';
break; break;
case 'webserver':
case MODULE_WEB:
$moduletype = MODULE_WEB;
// Remove content of $ip_target when it is ip_agent because
// it is used as HTTP auth (server) ....ONLY IN NEW MODULE!!!
if (empty($id_agent_module)
&& ($ip_target === agents_get_address($id_agente))
) {
$ip_target = '';
}
$categories = [9];
include 'module_manager_editor_common.php';
include 'module_manager_editor_web.php';
break;
// WARNING: type 7 is reserved on enterprise. // WARNING: type 7 is reserved on enterprise.
default: default:
if (enterprise_include( if (enterprise_include(

View File

@ -1,17 +1,32 @@
<?php <?php
/**
* Common editor fields.
*
* @category Module manager
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
require_once $config['homedir'].'/include/functions_modules.php'; require_once $config['homedir'].'/include/functions_modules.php';
require_once $config['homedir'].'/include/functions_categories.php'; require_once $config['homedir'].'/include/functions_categories.php';
require_once $config['homedir'].'/include/graphs/functions_d3.php'; require_once $config['homedir'].'/include/graphs/functions_d3.php';
@ -19,7 +34,10 @@ require_once $config['homedir'].'/include/graphs/functions_d3.php';
include_javascript_d3(); include_javascript_d3();
global $config;function prepend_table_simple($row, $id=false) global $config;
function prepend_table_simple($row, $id=false)
{ {
global $table_simple; global $table_simple;
@ -581,8 +599,12 @@ if ($moduletype == MODULE_DATA) {
$table_advanced->colspan[1][1] = 2; $table_advanced->colspan[1][1] = 2;
$interval_factor = 1; $interval_factor = 1;
if (isset($id_agente)) { if (isset($id_agente)) {
$agent_interval = agents_get_interval($id_agente); $agent_interval = (float) agents_get_interval($id_agente);
$interval_factor = ($interval / $agent_interval); if ($agent_interval > 0) {
$interval = (float) $interval;
$interval_factor = ($interval / $agent_interval);
}
$table_advanced->data[1][1] = human_time_description_raw($interval).' ('.sprintf(__('Agent interval x %s'), $interval_factor).') '; $table_advanced->data[1][1] = human_time_description_raw($interval).' ('.sprintf(__('Agent interval x %s'), $interval_factor).') ';
} else { } else {
$table_advanced->data[1][1] = sprintf(__('Agent interval x %s'), $interval_factor); $table_advanced->data[1][1] = sprintf(__('Agent interval x %s'), $interval_factor);
@ -1574,10 +1596,6 @@ $(document).ready (function () {
}); });
disabled_two_tailed(disabledBecauseInPolicy); disabled_two_tailed(disabledBecauseInPolicy);
$('#checkbox-dynamic_two_tailed').change (function() {
disabled_two_tailed(disabledBecauseInPolicy);
});
//Dynamic_options_advance; //Dynamic_options_advance;
$('.hide_dinamic').hide(); $('.hide_dinamic').hide();
@ -1646,15 +1664,10 @@ function disabled_status (disabledBecauseInPolicy) {
} }
function disabled_two_tailed (disabledBecauseInPolicy) { function disabled_two_tailed (disabledBecauseInPolicy) {
if($('#checkbox-dynamic_two_tailed').prop('checked')){ if (disabledBecauseInPolicy == 1){
$('#text-dynamic_max').prop('readonly', false); $('#text-dynamic_max')
$('#text-dynamic_max').removeClass('readonly'); .prop('readonly', true)
} .addClass('readonly');
else{
if (disabledBecauseInPolicy == 0){
$('#text-dynamic_max').prop('readonly', true);
$('#text-dynamic_max').addClass('readonly');
}
} }
} }

View File

@ -0,0 +1,419 @@
<?php
/**
* Web Module Editor for Module Manager.
*
* @category Module manager
* @package Pandora FMS
* @subpackage Module manager
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
enterprise_include_once('include/functions_policies.php');
$disabledBecauseInPolicy = false;
$disabledTextBecauseInPolicy = '';
$classdisabledBecauseInPolicy = '';
$page = get_parameter('page', '');
if (strstr($page, 'policy_modules') === false) {
if ($config['enterprise_installed']) {
if (policies_is_module_linked($id_agent_module) == 1) {
$disabledBecauseInPolicy = 1;
} else {
$disabledBecauseInPolicy = 0;
}
} else {
$disabledBecauseInPolicy = false;
}
if ($disabledBecauseInPolicy) {
$disabledTextBecauseInPolicy = 'disabled = "disabled"';
$classdisabledBecauseInPolicy = 'readonly';
}
}
global $id_agente;
$extra_title = __('Web server module');
// Div for modal.
html_print_div(
[
'id' => 'modal',
'style' => 'display: none;',
]
);
require_once $config['homedir'].'/include/ajax/web_server_module_debug.php';
define('ID_NETWORK_COMPONENT_TYPE', 7);
if (!$tcp_port && !$id_agent_module) {
$tcp_port = 80;
}
// plugin_server is the browser id
if ($plugin_user == '' && !$id_agent_module) {
$plugin_user = get_product_name().' / Webcheck';
}
// plugin_server is the referer
if ($plugin_pass == '' && !$id_agent_module) {
$plugin_pass = 1;
}
if (empty($update_module_id)) {
// Function in module_manager_editor_common.php
add_component_selection(ID_NETWORK_COMPONENT_TYPE);
} else {
// TODO: Print network component if available
}
$data = [];
$data[0] = __('Web checks');
$adopt = false;
if (isset($id_agent_module)) {
$adopt = enterprise_hook('policies_is_module_adopt', [$id_agent_module]);
}
$id_policy_module = (int) get_parameter('id_policy_module', '');
if ($id_policy_module) {
$module = enterprise_hook('policies_get_module', [$id_policy_module]);
$plugin_parameter = $module['plugin_parameter'];
}
$plugin_parameter_split = explode('&#x0a;', $plugin_parameter);
$plugin_parameter_final_split = '';
foreach ($plugin_parameter_split as $key => $value) {
if (strpos($value, 'http_auth_user') === false && strpos($value, 'http_auth_pass') === false) {
$plugin_parameter_final_split .= $value.'&#x0a;';
}
if (strpos($value, 'http_auth_user') !== false) {
$plugin_parameter_http_user = str_replace('http_auth_user&#x20;', '', $value);
}
if (strpos($value, 'http_auth_pass') !== false) {
$plugin_parameter_http_pass = str_replace('http_auth_pass&#x20;', '', $value);
}
}
if ((bool) $adopt === false) {
$data[1] = html_print_textarea(
'plugin_parameter',
15,
65,
$plugin_parameter_final_split,
$disabledTextBecauseInPolicy,
true,
'resizev'
);
} else {
$data[1] = html_print_textarea(
'plugin_parameter',
15,
65,
$plugin_parameter_final_split,
false,
true
);
}
$table_simple->colspan['web_checks'][1] = 2;
// Disable debug button if module has not started.
if ($id_agent_module > 0
&& db_get_value_filter(
'debug_content',
'tagente_modulo',
['id_agente_modulo' => $id_agent_module]
) !== null
) {
$disableDebug = false;
$hintDebug = __('Debug remotely this module');
} else {
$disableDebug = true;
$hintDebug = __('Debug this module once it has been initialized');
}
$suc_err_check = ' <span id="check_conf_suc" class="checks invisible">'.html_print_image('/images/ok.png', true).'</span>';
$suc_err_check .= ' <span id="check_conf_err" class="checks invisible">'.html_print_image('/images/error_red.png', true).'</span>';
$data[2] = html_print_button(
__('Load basic'),
'btn_loadbasic',
false,
'',
'class="sub config"',
true
).ui_print_help_tip(__('Load a basic structure on Web Checks'), true);
$data[2] .= '<br><br>'.html_print_button(
__('Check'),
'btn_checkconf',
false,
'',
'class="sub upd"',
true
).ui_print_help_tip(__('Check the correct structure of the WebCheck'), true).$suc_err_check;
$data[2] .= '<br><br>'.html_print_button(
__('Debug'),
'btn_debugModule',
$disableDebug,
'',
'class="sub config" onClick="loadDebugWindow()"',
true
).ui_print_help_tip($hintDebug, true);
push_table_simple($data, 'web_checks');
$http_checks_type = [
0 => 'Anyauth',
1 => 'NTLM',
2 => 'DIGEST',
3 => 'BASIC',
];
$data = [];
$data[0] = __('Check type');
$data[1] = html_print_select($http_checks_type, 'tcp_port', $tcp_port, false, '', '', true, false, false);
push_table_advanced($data, 'web_0');
$data = [];
$data[0] = __('Requests');
$data[1] = html_print_input_text('plugin_pass', $plugin_pass, '', 10, 0, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
$data[2] = '';
$data[3] = __('Agent browser id');
$data[4] = html_print_input_text('plugin_user', $plugin_user, '', 30, 0, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
push_table_advanced($data, 'web_1');
$data = [];
$data[0] = __('HTTP auth (login)');
$data[1] = html_print_input_text('http_user', $plugin_parameter_http_user, '', 10, 0, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
$data[2] = '';
$data[3] = __('HTTP auth (password)');
$data[4] = html_print_input_password('http_pass', $plugin_parameter_http_pass, '', 30, 0, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
push_table_advanced($data, 'web_2');
$data = [];
$data[0] = __('Proxy URL');
$data[1] = html_print_input_text('snmp_oid', $snmp_oid, '', 30, 0, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
$data[2] = $data[3] = $data[4] = '';
push_table_advanced($data, 'web_3');
$data = [];
$data[0] = __('Proxy auth (login)');
$data[1] = html_print_input_text('tcp_send', $tcp_send, '', 30, 0, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
$data[2] = '';
$data[3] = __('Proxy auth (pass)');
$data[4] = html_print_input_password('tcp_rcv', $tcp_rcv, '', 30, 0, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
push_table_advanced($data, 'web_4');
$data = [];
$data[0] = __('Proxy auth (server)');
$data[1] = html_print_input_text('ip_target', $ip_target, '', 30, 100, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
$data[2] = '';
$data[3] = __('Proxy auth (realm)');
$data[4] = html_print_input_text('snmp_community', $snmp_community, '', 30, 100, true, $disabledBecauseInPolicy, false, '', $classdisabledBecauseInPolicy);
push_table_advanced($data, 'web_5');
// Add some strings to be used from javascript
$texts = [
'lines_before_begin' => __('First line must be "task_begin"'),
'missed_begin' => __('Webchecks configuration is empty'),
'missed_end' => __('Last line must be "task_end"'),
'lines_after_end' => __('Last line must be "task_end"'),
'unknown_token' => __("There is a line with a unknown token 'token_fail'."),
'missed_get_post' => __("There isn't get or post"),
'correct' => __('Web checks are built correctly'),
];
foreach ($texts as $code => $text) {
echo '<span class="invisible" id="'.$code.'">'.$text.'</span>';
}
?>
<script type="text/javascript">
var supported_tokens = [
"task_begin",
"post",
"variable_name",
"variable_value",
"cookie",
"resource",
"get",
"check_string",
"check_not_string",
"get_content_advanced",
"get_content",
"debug",
"task_end",
"head"
];
$(document).ready(function() {
var plugin_parameter = $("#textarea_plugin_parameter");
$(plugin_parameter).keyup(function() {
// Check and fill textbox.
if ($(plugin_parameter).val() == '') {
$('#button-btn_loadbasic').removeAttr('disabled');
} else {
$('#button-btn_loadbasic').attr('disabled', 'disabled');
}
});
$('#button-btn_loadbasic').click(function() {
if ($(plugin_parameter).val() != '') {
return;
}
$(plugin_parameter).val(
'task_begin\ncookie 0\nresource 0\ntask_end');
$('#button-btn_loadbasic').attr('disabled', 'disabled');
// Hide success and error indicators
$('.checks').hide();
});
$('#button-btn_checkconf').click(function() {
var msg_error = '';
if (plugin_parameter.val() == '') {
msg_error = 'missed_begin';
} else {
var lines = plugin_parameter.val().split("\n");
var started = false;
var ended = false;
var lines_after_end = false;
var lines_before_begin = false;
var token_fail = false;
var token_get_post = false;
var token_check = true;
var str_token_fail = '';
for (i = 0; i < lines.length; i++) {
if (lines[i].match(/^\s*$/)) {
// Empty line
continue;
} else if (!started) {
if (lines[i].match(/^task_begin\s*$/)) {
started = true;
} else {
// Found a not empty line before task_begin
lines_before_begin = true;
break;
}
}
if (lines[i].match(/^task_end\s*$/)) {
ended = true;
continue;
}
//Check token is correct
if (!lines[i].match(/^([\s])*[#]/)) {
var token = lines[i].match(/^([^\s]+)\s*/);
if (typeof(token) == 'object') {
token = token[1];
if ((!token_get_post) && (token == 'get' || token == 'post' || token == 'header')) {
token_get_post = true;
continue;
}
if (token == 'check_string') {
if (token_get_post) {
token_check = true;
continue;
} else {
token_check = false;
continue;
}
}
if ($.inArray(token, supported_tokens) == -1) {
token_fail = true;
str_token_fail = token;
break;
}
}
}
}
}
var msg_error = '';
if (token_fail) {
var temp_msg = $("#unknown_token").html();
temp_msg = temp_msg.replace(/['](.*)[']/, "'" + str_token_fail + "'");
$("#unknown_token").html(temp_msg);
msg_error = 'unknown_token';
} else if (lines_before_begin) {
msg_error = 'lines_before_begin';
} else if (!started) {
msg_error = 'missed_begin';
} else if (!ended) {
msg_error = 'missed_end';
} else if (lines_after_end) {
msg_error = 'lines_after_end';
} else if (!token_check) {
msg_error = 'missed_get_post';
} else {
msg_error = 'correct';
}
if (msg_error == 'correct') {
$('#check_conf_suc').find('img').eq(0)
.attr('title', $('#' + msg_error).html());
$('#check_conf_err').hide();
$('#check_conf_suc').show();
} else {
$('#check_conf_err').find('img').eq(0)
.attr('title', $('#' + msg_error).html());
$('#check_conf_suc').hide();
$('#check_conf_err').show();
}
});
$(plugin_parameter).trigger('keyup');
});
</script>

View File

@ -64,7 +64,7 @@ $buttons = [
// Header. // Header.
ui_print_page_header( ui_print_page_header(
__('Planned Downtime'), __('Scheduled Downtime'),
'images/gm_monitoring.png', 'images/gm_monitoring.png',
false, false,
'', '',
@ -308,12 +308,12 @@ if ($create_downtime || $update_downtime) {
); );
} else { } else {
ui_print_error_message( ui_print_error_message(
__('Each planned downtime must have a different name') __('Each scheduled downtime must have a different name')
); );
} }
} else { } else {
ui_print_error_message( ui_print_error_message(
__('Planned downtime must have a name') __('Scheduled downtime must have a name')
); );
} }
} else if ($update_downtime) { } else if ($update_downtime) {
@ -345,7 +345,7 @@ if ($create_downtime || $update_downtime) {
$values = []; $values = [];
if (trim(io_safe_output($name)) == '') { if (trim(io_safe_output($name)) == '') {
ui_print_error_message( ui_print_error_message(
__('Planned downtime must have a name') __('Scheduled downtime must have a name')
); );
} }
@ -1015,7 +1015,21 @@ $table->data['module'][1] = "
'', '',
'', '',
0, 0,
true true,
false,
true,
'',
false,
false,
false,
false,
false,
'',
false,
false,
false,
false,
false
)."</td> )."</td>
<td class='datos2 button_cell' style='text-align: right; width:10%;' id=''>".'<div id="add_button_div">'.'<a class="add_button" href="">'.html_print_image( <td class='datos2 button_cell' style='text-align: right; width:10%;' id=''>".'<div id="add_button_div">'.'<a class="add_button" href="">'.html_print_image(
'images/add.png', 'images/add.png',
@ -1489,14 +1503,14 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
$(this).css ("width", "180px"); $(this).css ("width", "180px");
}); });
// Warning message about the problems caused updating a past planned downtime // Warning message about the problems caused updating a past scheduled downtime
var type_execution = "<?php echo $type_execution; ?>"; var type_execution = "<?php echo $type_execution; ?>";
var datetime_from = <?php echo json_encode(strtotime($once_date_from.' '.$once_time_from)); ?>; var datetime_from = <?php echo json_encode(strtotime($once_date_from.' '.$once_time_from)); ?>;
var datetime_now = <?php echo json_encode($utimestamp); ?>; var datetime_now = <?php echo json_encode($utimestamp); ?>;
var create = <?php echo json_encode($create); ?>; var create = <?php echo json_encode($create); ?>;
if (!create && (type_execution == 'periodically' || (type_execution == 'once' && datetime_from < datetime_now))) { if (!create && (type_execution == 'periodically' || (type_execution == 'once' && datetime_from < datetime_now))) {
$("input#submit-updbutton, input#submit-add_item, table#list a").click(function (e) { $("input#submit-updbutton, input#submit-add_item, table#list a").click(function (e) {
if (!confirm("<?php echo __('WARNING: If you edit this planned downtime, the data of future SLA reports may be altered'); ?>")) { if (!confirm("<?php echo __('WARNING: If you edit this scheduled downtime, the data of future SLA reports may be altered'); ?>")) {
e.preventDefault(); e.preventDefault();
} }
}); });

View File

@ -196,5 +196,5 @@ if (!empty($downtimes)) {
echo chr(13); echo chr(13);
} }
} else { } else {
echo '<div class="nf">'.__('No planned downtime').'</div>'; echo '<div class="nf">'.__('No scheduled downtime').'</div>';
} }

View File

@ -44,7 +44,7 @@ if ($migrate_malformed) {
if ($migration_result['status'] == false) { if ($migration_result['status'] == false) {
ui_print_error_message( ui_print_error_message(
__('An error occurred while migrating the malformed planned downtimes').'. '.__('Please run the migration again or contact with the administrator') __('An error occurred while migrating the malformed scheduled downtimes').'. '.__('Please run the migration again or contact with the administrator')
); );
echo '<br>'; echo '<br>';
} }
@ -80,7 +80,7 @@ if ($stop_downtime) {
$result = planned_downtimes_stop($downtime); $result = planned_downtimes_stop($downtime);
if ($result === false) { if ($result === false) {
ui_print_error_message(__('An error occurred stopping the planned downtime')); ui_print_error_message(__('An error occurred stopping the scheduled downtime'));
} else { } else {
echo $result['message']; echo $result['message'];
} }
@ -103,7 +103,7 @@ if ($delete_downtime) {
// The downtime shouldn't be running!! // The downtime shouldn't be running!!
if ($downtime['executed']) { if ($downtime['executed']) {
ui_print_error_message(__('This planned downtime is running')); ui_print_error_message(__('This scheduled downtime is running'));
} else { } else {
$result = db_process_sql_delete('tplanned_downtime', ['id' => $id_downtime]); $result = db_process_sql_delete('tplanned_downtime', ['id' => $id_downtime]);
@ -362,7 +362,7 @@ else if (!$downtimes) {
echo '</form>'; echo '</form>';
// Info message. // Info message.
echo '<div class="nf">'.__('No planned downtime').'</div>'; echo '<div class="nf">'.__('No scheduled downtime').'</div>';
echo '<div class="action-buttons w100p" >'; echo '<div class="action-buttons w100p" >';
@ -572,13 +572,13 @@ $(document).ready (function () {
$.datepicker.setDefaults($.datepicker.regional[ "<?php echo get_user_language(); ?>"]); $.datepicker.setDefaults($.datepicker.regional[ "<?php echo get_user_language(); ?>"]);
$("a#delete_downtime").click(function (e) { $("a#delete_downtime").click(function (e) {
if (!confirm("<?php echo __('WARNING: If you delete this planned downtime, it will not be taken into account in future SLA reports'); ?>")) { if (!confirm("<?php echo __('WARNING: If you delete this scheduled downtime, it will not be taken into account in future SLA reports'); ?>")) {
e.preventDefault(); e.preventDefault();
} }
}); });
if (<?php echo json_encode($malformed_downtimes_exist); ?> && <?php echo json_encode($migrate_malformed == false); ?>) { if (<?php echo json_encode($malformed_downtimes_exist); ?> && <?php echo json_encode($migrate_malformed == false); ?>) {
if (confirm("<?php echo __('WARNING: There are malformed planned downtimes').'.\n'.__('Do you want to migrate automatically the malformed items?'); ?>")) { if (confirm("<?php echo __('WARNING: There are malformed scheduled downtimes').'.\n'.__('Do you want to migrate automatically the malformed items?'); ?>")) {
window.location.href = "index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list&migrate_malformed=1"; window.location.href = "index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list&migrate_malformed=1";
} }
} }

View File

@ -469,4 +469,3 @@ if (is_central_policies_on_node() === false) {
} }
enterprise_hook('close_meta_frame'); enterprise_hook('close_meta_frame');
?>

View File

@ -810,7 +810,8 @@ foreach ($simple_alerts as $alert) {
'images/lightbulb_off.png', 'images/lightbulb_off.png',
1, 1,
'padding:0px', 'padding:0px',
true true,
['class' => 'invert_filter']
); );
$data[4] .= html_print_input_hidden('enable_alert', 1, true); $data[4] .= html_print_input_hidden('enable_alert', 1, true);
} else { } else {
@ -879,7 +880,10 @@ foreach ($simple_alerts as $alert) {
$data[4] .= html_print_image( $data[4] .= html_print_image(
'images/add.disabled.png', 'images/add.disabled.png',
true, true,
['title' => __('Add action')] [
'title' => __('Add action'),
'class' => 'invert_filter',
]
); );
} else { } else {
if ((int) $alert['id_policy_alerts'] === 0) { if ((int) $alert['id_policy_alerts'] === 0) {

View File

@ -224,31 +224,31 @@ $table_days->data[0] = array_fill(0, 7, html_print_image('images/blade.png', tru
$days = []; $days = [];
if ($template['monday']) { if ($template['monday']) {
$table_days->data[0][0] = html_print_image('images/tick.png', true); $table_days->data[0][0] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
} }
if ($template['tuesday']) { if ($template['tuesday']) {
$table_days->data[0][1] = html_print_image('images/tick.png', true); $table_days->data[0][1] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
} }
if ($template['wednesday']) { if ($template['wednesday']) {
$table_days->data[0][2] = html_print_image('images/tick.png', true); $table_days->data[0][2] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
} }
if ($template['thursday']) { if ($template['thursday']) {
$table_days->data[0][3] = html_print_image('images/tick.png', true); $table_days->data[0][3] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
} }
if ($template['friday']) { if ($template['friday']) {
$table_days->data[0][4] = html_print_image('images/tick.png', true); $table_days->data[0][4] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
} }
if ($template['saturday']) { if ($template['saturday']) {
$table_days->data[0][5] = html_print_image('images/tick.png', true); $table_days->data[0][5] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
} }
if ($template['sunday']) { if ($template['sunday']) {
$table_days->data[0][6] = html_print_image('images/tick.png', true); $table_days->data[0][6] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
} }
$data[0] = html_print_table($table_days, true); $data[0] = html_print_table($table_days, true);
@ -265,7 +265,7 @@ $table_time->styleTable = 'padding: 1px; margin: 0px; text-align: center; height
// $data[0] = __('Time from') . ' / ' . __('Time to'); // $data[0] = __('Time from') . ' / ' . __('Time to');
if ($template['time_from'] == $template['time_to']) { if ($template['time_from'] == $template['time_to']) {
$table_time->head[0] = '00:00:00<br>-<br>23:59:59'; $table_time->head[0] = '00:00:00<br>-<br>23:59:59';
$table_time->data[0][0] = html_print_image('images/tick.png', true); $table_time->data[0][0] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
} else { } else {
$from_array = explode(':', $template['time_from']); $from_array = explode(':', $template['time_from']);
$from = ($from_array[0] * SECONDS_1HOUR + $from_array[1] * SECONDS_1MINUTE + $from_array[2]); $from = ($from_array[0] * SECONDS_1HOUR + $from_array[1] * SECONDS_1MINUTE + $from_array[2]);
@ -278,7 +278,7 @@ if ($template['time_from'] == $template['time_to']) {
} }
$table_time->head[1] = $template['time_from'].'<br>-<br>'.$template['time_to']; $table_time->head[1] = $template['time_from'].'<br>-<br>'.$template['time_to'];
$table_time->data[0][1] = html_print_image('images/tick.png', true); $table_time->data[0][1] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
if ($template['time_to'] != '23:59:59') { if ($template['time_to'] != '23:59:59') {
$table_time->head[2] = $template['time_to'].'<br>-<br>23:59:59'; $table_time->head[2] = $template['time_to'].'<br>-<br>23:59:59';
@ -287,15 +287,15 @@ if ($template['time_from'] == $template['time_to']) {
} else { } else {
if ($template['time_to'] != '00:00:00') { if ($template['time_to'] != '00:00:00') {
$table_time->head[0] = '00:00:00<br>-<br>'.$template['time_to']; $table_time->head[0] = '00:00:00<br>-<br>'.$template['time_to'];
$table_time->data[0][0] = html_print_image('images/tick.png', true); $table_time->data[0][0] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
} }
$table_time->head[1] = $template['time_to'].'<br>-<br>'.$template['time_from']; $table_time->head[1] = $template['time_to'].'<br>-<br>'.$template['time_from'];
$table_time->data[0][1] = html_print_image('images/blade.png', true); $table_time->data[0][1] = html_print_image('images/blade.png', true, ['class' => 'invert_filter']);
if ($template['time_from'] != '23:59:59') { if ($template['time_from'] != '23:59:59') {
$table_time->head[2] = $template['time_from'].'<br>-<br>23:59:59'; $table_time->head[2] = $template['time_from'].'<br>-<br>23:59:59';
$table_time->data[0][2] = html_print_image('images/tick.png', true); $table_time->data[0][2] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
} }
} }
@ -354,7 +354,7 @@ $table->style[0] = 'font-weight: bold; text-align: left;';
if (count($actions) == 1 && isset($actions[0])) { if (count($actions) == 1 && isset($actions[0])) {
$table->head[1] = __('Every time that the alert is fired'); $table->head[1] = __('Every time that the alert is fired');
$table->data[0][0] = $actions[0]['name']; $table->data[0][0] = $actions[0]['name'];
$table->data[0][1] = html_print_image('images/tick.png', true); $table->data[0][1] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
} else { } else {
foreach ($actions as $kaction => $action) { foreach ($actions as $kaction => $action) {
$table->data[$kaction][0] = $action['name']; $table->data[$kaction][0] = $action['name'];
@ -364,7 +364,7 @@ if (count($actions) == 1 && isset($actions[0])) {
foreach ($action['escalation'] as $k => $v) { foreach ($action['escalation'] as $k => $v) {
if ($v > 0) { if ($v > 0) {
$table->data[$kaction][$k] = html_print_image('images/tick.png', true); $table->data[$kaction][$k] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
} else { } else {
$table->data[$kaction][$k] = html_print_image('images/blade.png', true); $table->data[$kaction][$k] = html_print_image('images/blade.png', true);
} }

View File

@ -43,7 +43,7 @@ if (is_ajax()) {
if ($get_integria_ticket_custom_types) { if ($get_integria_ticket_custom_types) {
$ticket_type_id = get_parameter('ticket_type_id'); $ticket_type_id = get_parameter('ticket_type_id');
$api_call = integria_api_call($config['integria_hostname'], $config['integria_user'], $config['integria_pass'], $config['integria_api_pass'], 'get_incident_fields', $ticket_type_id, false, 'json'); $api_call = integria_api_call(null, null, null, null, 'get_incident_fields', $ticket_type_id, false, 'json');
echo $api_call; echo $api_call;
return; return;

View File

@ -143,7 +143,7 @@ if ($duplicate_template) {
// If user doesn't have the permission to access All group and source template is All group, then group is changed to the first group of user. // If user doesn't have the permission to access All group and source template is All group, then group is changed to the first group of user.
if ($can_edit_all == false && a_template['id_group'] == 0) { if ($can_edit_all == false && a_template['id_group'] == 0) {
$a_template['id_group'] = users_get_first_group(false, 'LM', false); $a_template['id_group'] = users_get_first_group(false, 'LM', false);
} }
$id = alerts_duplicate_alert_template($source_id, $a_template['id_group']); $id = alerts_duplicate_alert_template($source_id, $a_template['id_group']);
@ -609,7 +609,7 @@ if ($step == 2) {
1, 1,
$monday, $monday,
true, true,
$is_central_policies_on_node | $disabled ($is_central_policies_on_node | $disabled)
); );
$table->data[0][1] .= __('Tue'); $table->data[0][1] .= __('Tue');
$table->data[0][1] .= html_print_checkbox( $table->data[0][1] .= html_print_checkbox(
@ -617,7 +617,7 @@ if ($step == 2) {
1, 1,
$tuesday, $tuesday,
true, true,
$is_central_policies_on_node | $disabled ($is_central_policies_on_node | $disabled)
); );
$table->data[0][1] .= __('Wed'); $table->data[0][1] .= __('Wed');
$table->data[0][1] .= html_print_checkbox( $table->data[0][1] .= html_print_checkbox(
@ -625,7 +625,7 @@ if ($step == 2) {
1, 1,
$wednesday, $wednesday,
true, true,
$is_central_policies_on_node | $disabled ($is_central_policies_on_node | $disabled)
); );
$table->data[0][1] .= __('Thu'); $table->data[0][1] .= __('Thu');
$table->data[0][1] .= html_print_checkbox( $table->data[0][1] .= html_print_checkbox(
@ -633,7 +633,7 @@ if ($step == 2) {
1, 1,
$thursday, $thursday,
true, true,
$is_central_policies_on_node | $disabled ($is_central_policies_on_node | $disabled)
); );
$table->data[0][1] .= __('Fri'); $table->data[0][1] .= __('Fri');
$table->data[0][1] .= html_print_checkbox( $table->data[0][1] .= html_print_checkbox(
@ -641,7 +641,7 @@ if ($step == 2) {
1, 1,
$friday, $friday,
true, true,
$is_central_policies_on_node | $disabled ($is_central_policies_on_node | $disabled)
); );
$table->data[0][1] .= __('Sat'); $table->data[0][1] .= __('Sat');
$table->data[0][1] .= html_print_checkbox( $table->data[0][1] .= html_print_checkbox(
@ -649,7 +649,7 @@ if ($step == 2) {
1, 1,
$saturday, $saturday,
true, true,
$is_central_policies_on_node | $disabled ($is_central_policies_on_node | $disabled)
); );
$table->data[0][1] .= __('Sun'); $table->data[0][1] .= __('Sun');
$table->data[0][1] .= html_print_checkbox( $table->data[0][1] .= html_print_checkbox(
@ -657,7 +657,7 @@ if ($step == 2) {
1, 1,
$sunday, $sunday,
true, true,
$is_central_policies_on_node | $disabled ($is_central_policies_on_node | $disabled)
); );
$table->data[0][2] = __('Use special days list'); $table->data[0][2] = __('Use special days list');
@ -666,7 +666,7 @@ if ($step == 2) {
1, 1,
$special_day, $special_day,
true, true,
$is_central_policies_on_node | $disabled ($is_central_policies_on_node | $disabled)
); );
$table->data[1][0] = __('Time from'); $table->data[1][0] = __('Time from');
@ -687,7 +687,7 @@ if ($step == 2) {
'', '',
'', '',
'', '',
$is_central_policies_on_node | $disabled ($is_central_policies_on_node | $disabled)
); );
$table->data[1][2] = __('Time to'); $table->data[1][2] = __('Time to');
$table->data[1][3] = html_print_input_text( $table->data[1][3] = html_print_input_text(
@ -707,7 +707,7 @@ if ($step == 2) {
'', '',
'', '',
'', '',
$is_central_policies_on_node | $disabled ($is_central_policies_on_node | $disabled)
); );
$table->colspan['threshold'][1] = 3; $table->colspan['threshold'][1] = 3;
@ -723,7 +723,7 @@ if ($step == 2) {
false, false,
true, true,
'', '',
$is_central_policies_on_node | $disabled ($is_central_policies_on_node | $disabled)
); );
$table->data[3][0] = __('Min. number of alerts'); $table->data[3][0] = __('Min. number of alerts');
@ -744,7 +744,7 @@ if ($step == 2) {
'', '',
'', '',
'', '',
$is_central_policies_on_node | $disabled ($is_central_policies_on_node | $disabled)
); );
$table->data[3][2] = __('Reset counter for non-sustained alerts'); $table->data[3][2] = __('Reset counter for non-sustained alerts');
@ -757,7 +757,7 @@ if ($step == 2) {
1, 1,
$min_alerts_reset_counter, $min_alerts_reset_counter,
true, true,
$is_central_policies_on_node | $disabled, ($is_central_policies_on_node | $disabled),
'', '',
false, false,
$create_template == 1 ? 'checked=checked' : '' $create_template == 1 ? 'checked=checked' : ''
@ -781,7 +781,7 @@ if ($step == 2) {
'', '',
'', '',
'', '',
$is_central_policies_on_node | $disabled ($is_central_policies_on_node | $disabled)
); );
$table->data[4][2] = __('Disable event'); $table->data[4][2] = __('Disable event');
@ -790,7 +790,7 @@ if ($step == 2) {
1, 1,
$disable_event, $disable_event,
true, true,
$is_central_policies_on_node | $disabled ($is_central_policies_on_node | $disabled)
); );
$table->data[5][0] = __('Default action'); $table->data[5][0] = __('Default action');
@ -818,7 +818,7 @@ if ($step == 2) {
true, true,
false, false,
false, false,
$is_central_policies_on_node | $disabled, ($is_central_policies_on_node | $disabled),
false, false,
false, false,
0 0
@ -840,7 +840,7 @@ if ($step == 2) {
false, false,
false, false,
'', '',
$is_central_policies_on_node | $disabled ($is_central_policies_on_node | $disabled)
); );
$table->data[6][1] .= '<span id="matches_value" '.($show_matches ? '' : 'class="invisible"').'>'; $table->data[6][1] .= '<span id="matches_value" '.($show_matches ? '' : 'class="invisible"').'>';
$table->data[6][1] .= '&nbsp;'.html_print_checkbox('matches_value', 1, $matches, true); $table->data[6][1] .= '&nbsp;'.html_print_checkbox('matches_value', 1, $matches, true);
@ -949,7 +949,7 @@ if ($step == 2) {
false, false,
false, false,
'', '',
$is_central_policies_on_node | $disabled ($is_central_policies_on_node | $disabled)
); );
$table->colspan[0][1] = 2; $table->colspan[0][1] = 2;
@ -975,7 +975,7 @@ if ($step == 2) {
0, 0,
'', '',
false, false,
$is_central_policies_on_node | $disabled, ($is_central_policies_on_node | $disabled),
"removeTinyMCE('textarea_field".$i."')", "removeTinyMCE('textarea_field".$i."')",
'', '',
true true
@ -988,7 +988,7 @@ if ($step == 2) {
0, 0,
'', '',
true, true,
$is_central_policies_on_node | $disabled, ($is_central_policies_on_node | $disabled),
"addTinyMCE('textarea_field".$i."')", "addTinyMCE('textarea_field".$i."')",
'', '',
true true
@ -1004,7 +1004,7 @@ if ($step == 2) {
'class="fields" min-height-40px', 'class="fields" min-height-40px',
true, true,
'', '',
$is_central_policies_on_node | $disabled ($is_central_policies_on_node | $disabled)
); );
// Recovery. // Recovery.
@ -1016,7 +1016,7 @@ if ($step == 2) {
0, 0,
'', '',
false, false,
$is_central_policies_on_node | $disabled, ($is_central_policies_on_node | $disabled),
"removeTinyMCE('textarea_field".$i."_recovery')", "removeTinyMCE('textarea_field".$i."_recovery')",
'', '',
true true
@ -1029,7 +1029,7 @@ if ($step == 2) {
0, 0,
'', '',
true, true,
$is_central_policies_on_node | $disabled, ($is_central_policies_on_node | $disabled),
"addTinyMCE('textarea_field".$i."_recovery')", "addTinyMCE('textarea_field".$i."_recovery')",
'', '',
true true
@ -1045,7 +1045,7 @@ if ($step == 2) {
'class="fields min-height-40px"', 'class="fields min-height-40px"',
true, true,
'', '',
$is_central_policies_on_node | $disabled ($is_central_policies_on_node | $disabled)
); );
} }
} else { } else {
@ -1102,7 +1102,7 @@ if ($step == 2) {
'', '',
'', '',
'', '',
$is_central_policies_on_node | $disabled ($is_central_policies_on_node | $disabled)
); );
@ -1134,7 +1134,7 @@ if ($step == 2) {
false, false,
true, true,
'', '',
$is_central_policies_on_node | $disabled ($is_central_policies_on_node | $disabled)
).'</div>'; ).'</div>';
@ -1147,7 +1147,7 @@ if ($step == 2) {
'', '',
true, true,
'', '',
$is_central_policies_on_node | $disabled ($is_central_policies_on_node | $disabled)
); );
$table->data[2][0] = __('Priority'); $table->data[2][0] = __('Priority');
@ -1162,7 +1162,7 @@ if ($step == 2) {
false, false,
false, false,
'', '',
$is_central_policies_on_node | $disabled ($is_central_policies_on_node | $disabled)
); );
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {

View File

@ -200,11 +200,7 @@ $table->data[5] = $data;
if ($event_response_id == 0) { if ($event_response_id == 0) {
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=responses&mode=list&action=create_response&amp;pure='.$config['pure'].'">'; echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=responses&mode=list&action=create_response&amp;pure='.$config['pure'].'">';
html_print_table($table); html_print_table($table);
if (!defined('METACONSOLE')) {
echo '<div class="w100p right_align">'; echo '<div class="w100p right_align">';
} else {
echo '<div class="w100p right">';
}
html_print_submit_button(__('Create'), 'create_response_button', false, ['class' => 'sub next']); html_print_submit_button(__('Create'), 'create_response_button', false, ['class' => 'sub next']);
echo '</div>'; echo '</div>';
@ -212,11 +208,7 @@ if ($event_response_id == 0) {
} else { } else {
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=responses&mode=list&action=update_response&amp;pure='.$config['pure'].'">'; echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=responses&mode=list&action=update_response&amp;pure='.$config['pure'].'">';
html_print_table($table); html_print_table($table);
if (!defined('METACONSOLE')) {
echo '<div class="w100p right_align">'; echo '<div class="w100p right_align">';
} else {
echo '<div class="w100p right">';
}
html_print_submit_button(__('Update'), 'update_response_button', false, ['class' => 'sub next']); html_print_submit_button(__('Update'), 'update_response_button', false, ['class' => 'sub next']);
echo '</div>'; echo '</div>';

View File

@ -15,7 +15,7 @@ global $config;
check_login(); check_login();
$gis_w = check_acl($config['id_user'], 0, 'MW'); $gis_w = check_acl($config['id_user'], 0, 'MW', false, true, true);
$gis_m = check_acl($config['id_user'], 0, 'MM'); $gis_m = check_acl($config['id_user'], 0, 'MM');
$access = ($gis_w == true) ? 'MW' : (($gis_m == true) ? 'MM' : 'MW'); $access = ($gis_w == true) ? 'MW' : (($gis_m == true) ? 'MM' : 'MW');
@ -490,7 +490,7 @@ if (users_can_manage_group_all('MM') === true) {
$table->data[2][0] = __('Group'); $table->data[2][0] = __('Group');
$table->data[2][1] = html_print_select_groups( $table->data[2][1] = html_print_select_groups(
false, false,
'IW', 'AR',
$return_all_group, $return_all_group,
'map_group_id', 'map_group_id',
$map_group_id, $map_group_id,

View File

@ -95,7 +95,7 @@ if ($id_group) {
} }
// Header // Header
if (defined('METACONSOLE')) { if (is_metaconsole() === true) {
agents_meta_print_header(); agents_meta_print_header();
$sec = 'advanced'; $sec = 'advanced';
} else { } else {
@ -105,13 +105,24 @@ if (defined('METACONSOLE')) {
$title_in_header = __('Create group'); $title_in_header = __('Create group');
} }
ui_print_page_header( // Header.
ui_print_standard_header(
$title_in_header, $title_in_header,
'images/group.png', 'images/group.png',
false, false,
'', '',
true, false,
'' [],
[
[
'link' => '',
'label' => __('Profiles'),
],
[
'link' => '',
'label' => __('Manage agents group'),
],
]
); );
$sec = 'gagente'; $sec = 'gagente';
} }

View File

@ -333,6 +333,7 @@ $title = __('Groups defined in %s', get_product_name());
switch ($tab) { switch ($tab) {
case 'tree': case 'tree':
$buttons['tree']['active'] = true; $buttons['tree']['active'] = true;
$title .= sprintf(' &raquo; %s', __('Tree view'));
break; break;
case 'credbox': case 'credbox':
@ -343,23 +344,38 @@ switch ($tab) {
case 'groups': case 'groups':
default: default:
$buttons['groups']['active'] = true; $buttons['groups']['active'] = true;
$title .= sprintf(' &raquo; %s', __('Table view'));
break; break;
} }
// Header. // Header.
if (is_metaconsole() === true) { if (is_metaconsole() === true) {
agents_meta_print_header(); agents_meta_print_header();
echo '<div class="notify">'; html_print_div(
echo __('Edit or delete groups can cause problems with synchronization'); [
echo '</div>'; 'class' => 'notify',
'content' => __('Edit or delete groups can cause problems with synchronization'),
]
);
} else { } else {
ui_print_page_header( // Header.
ui_print_standard_header(
$title, $title,
'images/group.png', 'images/group.png',
false, false,
'', '',
true, false,
$buttons $buttons,
[
[
'link' => '',
'label' => __('Profiles'),
],
[
'link' => '',
'label' => __('Manage agents group'),
],
]
); );
} }
@ -471,7 +487,7 @@ if ($update_group) {
$values = [ $values = [
'nombre' => $name, 'nombre' => $name,
'icon' => empty($icon) ? '' : substr($icon, 0, -4), 'icon' => empty($icon) ? '' : substr($icon, 0, -4),
'parent' => $id_parent == -1 ? 0 : $id_parent, 'parent' => ($id_parent == -1) ? 0 : $id_parent,
'disabled' => !$alerts_enabled, 'disabled' => !$alerts_enabled,
'custom_id' => $custom_id, 'custom_id' => $custom_id,
'id_skin' => $skin, 'id_skin' => $skin,

View File

@ -261,7 +261,10 @@ $table->data[1][2] .= html_print_select(
); );
$table->data[1][3] = html_print_select([], 'module[]', '', false, '', '', true, true, false, '', false, 'width:180px;'); $table->data[1][3] = html_print_select([], 'module[]', '', false, '', '', true, true, false, '', false, 'width:180px;');
$templates = alerts_get_alert_templates(false, ['id', 'name']); $usr_groups = users_get_groups($config['id_user'], 'LW', true);
$filter_groups = '';
$filter_groups = implode(',', array_keys($usr_groups));
$templates = alerts_get_alert_templates(['id_group IN ('.$filter_groups.')'], ['id', 'name']);
$table->data[2][0] = __('Alert template'); $table->data[2][0] = __('Alert template');
$table->data[2][1] = html_print_select( $table->data[2][1] = html_print_select(
index_array($templates, 'id', 'name'), index_array($templates, 'id', 'name'),

View File

@ -252,7 +252,10 @@ $table->size[3] = '40%';
$table->data = []; $table->data = [];
$templates = alerts_get_alert_templates(false, ['id', 'name']); $usr_groups = users_get_groups($config['id_user'], 'LW', true);
$filter_groups = '';
$filter_groups = implode(',', array_keys($usr_groups));
$templates = alerts_get_alert_templates(['id_group IN ('.$filter_groups.')'], ['id', 'name']);
$table->data[0][0] = __('Alert template'); $table->data[0][0] = __('Alert template');
$table->data[0][1] = html_print_select( $table->data[0][1] = html_print_select(
index_array($templates, 'id', 'name'), index_array($templates, 'id', 'name'),

View File

@ -58,12 +58,27 @@ $buttons['view'] = [
$tab = get_parameter('tab', 'view'); $tab = get_parameter('tab', 'view');
if ($tab != 'search_module') { if ($tab !== 'search_module') {
$buttons[$tab]['active'] = true; $buttons[$tab]['active'] = true;
} }
ui_print_page_header(__('Module Library').' &raquo; '.__('View'), '', false, 'module_library', true, $buttons); $headerTitle = ($tab === 'categories') ? __('Categories') : __('Main view');
// Header.
ui_print_standard_header(
$headerTitle,
'',
false,
'module_library',
true,
$buttons,
[
[
'link' => '',
'label' => __('Module library'),
],
]
);
// Styles. // Styles.
ui_require_css_file('module_library'); ui_require_css_file('module_library');

View File

@ -20,15 +20,6 @@ require_once $config['homedir'].'/include/functions_html.php';
check_login(); check_login();
if (! check_acl($config['id_user'], 0, 'IW')) {
db_pandora_audit(
'ACL Violation',
'Trying to access event viewer'
);
include 'general/noaccess.php';
return;
}
// id report // id report
$id = (int) get_parameter('id'); $id = (int) get_parameter('id');

View File

@ -73,7 +73,7 @@ if (! check_acl($config['id_user'], 0, 'RW')
exit; exit;
} }
if ($edit_graph) { if ($edit_graph === true) {
$graphInTgraph = db_get_row_sql( $graphInTgraph = db_get_row_sql(
'SELECT * FROM tgraph WHERE id_graph = '.$id_graph 'SELECT * FROM tgraph WHERE id_graph = '.$id_graph
); );
@ -113,18 +113,18 @@ if ($edit_graph) {
// ----------------------- // -----------------------
// CREATE/EDIT GRAPH FORM // CREATE/EDIT GRAPH FORM
// ----------------------- // -----------------------
$url = 'index.php?sec=reporting&sec2=godmode/reporting/graph_builder'; $url = 'index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1';
if ($edit_graph) { if ($edit_graph === true) {
$output = "<form method='post' action='".$url.'&edit_graph=1&update_graph=1&id='.$id_graph."'>"; $output = "<form method='post' action='".$url.'&update_graph=1&id='.$id_graph."'>";
} else { } else {
$output = "<form method='post' action='".$url."&edit_graph=1&add_graph=1'>"; $output = "<form method='post' action='".$url."&add_graph=1'>";
} }
$output .= "<table width='100%' cellpadding=4 cellspacing=4 class='databox filters'>"; $output .= "<table width='100%' cellpadding=4 cellspacing=4 class='databox filters'>";
$output .= '<tr>'; $output .= '<tr>';
$output .= "<td class='datos'><b>".__('Name').'</b></td>'; $output .= "<td class='datos'><b>".__('Name').'</b></td>';
$output .= "<td class='datos'><input type='text' name='name' size='25' "; $output .= "<td class='datos'><input type='text' name='name' size='25' ";
if ($edit_graph) { if ($edit_graph === true) {
$output .= "value='".$graphInTgraph['name']."' "; $output .= "value='".$graphInTgraph['name']."' ";
} }
@ -179,7 +179,7 @@ $output .= '</td></tr>';
$output .= '<tr>'; $output .= '<tr>';
$output .= "<td class='datos2'><b>".__('Description').'</b></td>'; $output .= "<td class='datos2'><b>".__('Description').'</b></td>';
$output .= "<td class='datos2' colspan=3><textarea name='description' class='height_45px' cols=55 rows=2>"; $output .= "<td class='datos2' colspan=3><textarea name='description' class='height_45px' cols=55 rows=2>";
if ($edit_graph) { if ($edit_graph === true) {
$output .= $graphInTgraph['description']; $output .= $graphInTgraph['description'];
} }
@ -291,15 +291,30 @@ $output .= '</tr>';
$output .= '</table>'; $output .= '</table>';
if ($edit_graph) { $stringButton = ($edit_graph === true) ? __('Update') : __('Create');
$output .= "<div class='w100p'>";
$output .= "<input type=submit name='store' class='sub upd right' value='".__('Update')."'>"; $output .= html_print_div(
$output .= '</div>'; [
} else { 'class' => 'w100p',
$output .= "<div class='w100p'>"; 'content' => "<input type=submit name='store' class='sub next right databox' value='".$stringButton."'>",
$output .= "<input type=submit name='store' class='sub next right' value='".__('Create')."'>"; ],
$output .= '</div>'; true
} );
$output .= html_print_div(
[
'class' => 'w100p',
'content' => html_print_button(
__('Go back'),
'go_back',
false,
'window.location.href = \'index.php?sec=reporting&sec2=godmode/reporting/graphs\'',
'class="sub cancel right"',
true
),
],
true
);
$output .= '</form>'; $output .= '</form>';

View File

@ -26,10 +26,9 @@
* ============================================================================ * ============================================================================
*/ */
// Begin.
global $config; global $config;
if (is_ajax()) { if (is_ajax()) {
$search_agents = (bool) get_parameter('search_agents'); $search_agents = (bool) get_parameter('search_agents');
@ -110,7 +109,7 @@ if ($id_graph !== 0) {
} }
if ($add_graph) { if ($add_graph === true) {
$name = get_parameter_post('name'); $name = get_parameter_post('name');
$description = get_parameter_post('description'); $description = get_parameter_post('description');
$module_number = get_parameter_post('module_number'); $module_number = get_parameter_post('module_number');
@ -179,7 +178,7 @@ if ($update_graph) {
$stacked = $threshold; $stacked = $threshold;
} }
if (trim($name) != '') { if (empty(trim($name)) === false) {
$success = db_process_sql_update( $success = db_process_sql_update(
'tgraph', 'tgraph',
[ [
@ -221,7 +220,7 @@ function add_quotes($item)
} }
if ($add_module) { if ($add_module === true) {
$id_graph = get_parameter('id'); $id_graph = get_parameter('id');
$id_modules = get_parameter('module'); $id_modules = get_parameter('module');
$id_agents = get_parameter('id_agents'); $id_agents = get_parameter('id_agents');
@ -252,7 +251,7 @@ if ($add_module) {
} }
} }
if ($delete_module) { if ($delete_module === true) {
$id_graph = get_parameter('id'); $id_graph = get_parameter('id');
$deleteGraph = get_parameter('delete'); $deleteGraph = get_parameter('delete');
@ -261,7 +260,7 @@ if ($delete_module) {
db_process_sql('UPDATE tgraph_source SET field_order=field_order-1 WHERE id_graph='.$id_graph.' AND field_order>'.$order_val); db_process_sql('UPDATE tgraph_source SET field_order=field_order-1 WHERE id_graph='.$id_graph.' AND field_order>'.$order_val);
} }
if ($change_weight) { if ($change_weight === true) {
$weight = get_parameter('weight'); $weight = get_parameter('weight');
$id_gs = get_parameter('graph'); $id_gs = get_parameter('graph');
db_process_sql_update( db_process_sql_update(
@ -281,7 +280,7 @@ if ($change_label) {
); );
} }
if ($edit_graph) { if ($edit_graph === true) {
$buttons = [ $buttons = [
'graph_list' => [ 'graph_list' => [
'active' => false, 'active' => false,
@ -319,7 +318,7 @@ if ($edit_graph) {
'view' => [ 'view' => [
'active' => false, 'active' => false,
'text' => '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.$id_graph.'">'.html_print_image( 'text' => '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.$id_graph.'">'.html_print_image(
'images/operation.png', 'images/eye.png',
true, true,
[ [
'title' => __('View graph'), 'title' => __('View graph'),
@ -335,42 +334,48 @@ if ($edit_graph) {
$graphInTgraph = db_get_row_sql('SELECT name FROM tgraph WHERE id_graph = '.$id_graph); $graphInTgraph = db_get_row_sql('SELECT name FROM tgraph WHERE id_graph = '.$id_graph);
$name = $graphInTgraph['name']; $name = $graphInTgraph['name'];
} else { } else {
$buttons = ''; $buttons = [];
} }
$head = __('Graph builder'); $head = __('Graph builder');
if (isset($name)) { if (isset($name) === true) {
$head .= ' - '.$name; $head .= ' &raquo; '.$name;
} }
// Header. // Header.
$tab = get_parameter('tab', ''); $tab = get_parameter('tab');
switch ($tab) { switch ($tab) {
default: case 'graph_editor':
case 'main': $headerHelp = '';
ui_print_page_header(
$head,
'images/chart.png',
false,
'graph_builder',
false,
$buttons
);
break; break;
case 'graph_editor': case 'main':
ui_print_page_header( default:
$head, $headerHelp = 'graph_builder';
'images/chart.png',
false,
'',
false,
$buttons
);
break; break;
} }
// Header.
ui_print_standard_header(
$head,
'images/chart.png',
false,
$headerHelp,
false,
$buttons,
[
[
'link' => '',
'label' => __('Reporting'),
],
[
'link' => '',
'label' => __('Custom graphs'),
],
]
);
if ($add_graph) { if ($add_graph) {
ui_print_result_message( ui_print_result_message(
$id_graph, $id_graph,
@ -405,12 +410,12 @@ if ($delete_module) {
// Parse CHUNK information into showable information. // Parse CHUNK information into showable information.
// Split id to get all parameters. // Split id to get all parameters.
if (!$delete_module) { if ($delete_module === false) {
if (isset($_POST['period'])) { if (isset($_POST['period']) === true) {
$period = $_POST['period']; $period = $_POST['period'];
} }
if ((isset($chunkdata) ) && ($chunkdata != '')) { if ((isset($chunkdata) === true) && (empty($chunkdata) === false)) {
$module_array = []; $module_array = [];
$weight_array = []; $weight_array = [];
$agent_array = []; $agent_array = [];
@ -418,7 +423,8 @@ if (!$delete_module) {
$chunk1 = explode('|', $chunkdata); $chunk1 = explode('|', $chunkdata);
$modules = ''; $modules = '';
$weights = ''; $weights = '';
for ($a = 0; $a < count($chunk1); $a++) { $chunkCount = count($chunk1);
for ($a = 0; $a < $chunkCount; $a++) {
$chunk2[$a] = []; $chunk2[$a] = [];
$chunk2[$a] = explode(',', $chunk1[$a]); $chunk2[$a] = explode(',', $chunk1[$a]);
if (strpos($modules, $chunk2[$a][1]) == 0) { if (strpos($modules, $chunk2[$a][1]) == 0) {
@ -450,4 +456,8 @@ switch ($active_tab) {
case 'graph_editor': case 'graph_editor':
include_once 'godmode/reporting/graph_builder.graph_editor.php'; include_once 'godmode/reporting/graph_builder.graph_editor.php';
break; break;
default:
// Nothing to do.
break;
} }

View File

@ -1,19 +1,35 @@
<?php <?php
// Pandora FMS - http://pandorafms.com /**
// ================================================== * Custom graph containers
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas *
// Please see http://pandorafms.org for full contribution list * @category Reporting
// This program is free software; you can redistribute it and/or * @package Pandora FMS
// modify it under the terms of the GNU General Public License * @subpackage Community
// as published by the Free Software Foundation for version 2. * @version 1.0.0
// This program is distributed in the hope that it will be useful, * @license See below
// but WITHOUT ANY WARRANTY; without even the implied warranty of *
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * ______ ___ _______ _______ ________
// GNU General Public License for more details. * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
// Load global variables * | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2007-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
global $config; global $config;
// Check user credentials // Check user credentials.
check_login(); check_login();
if (! check_acl($config['id_user'], 0, 'RR') || enterprise_installed() === false) { if (! check_acl($config['id_user'], 0, 'RR') || enterprise_installed() === false) {
@ -87,8 +103,26 @@ $buttons['graph_container'] = [
] ]
).'</a>', ).'</a>',
]; ];
// Header
ui_print_page_header(__('Graph container'), '', false, '', false, $buttons); // Header.
ui_print_standard_header(
__('Graph container'),
'',
false,
'',
false,
$buttons,
[
[
'link' => '',
'label' => __('Reporting'),
],
[
'link' => '',
'label' => __('Custom graphs'),
],
]
);
$container = folder_get_folders(); $container = folder_get_folders();

View File

@ -1,16 +1,32 @@
<?php <?php
// Pandora FMS - http://pandorafms.com /**
// ================================================== * Reporting graphs.
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas *
// Please see http://pandorafms.org for full contribution list * @category Reporting
// This program is free software; you can redistribute it and/or * @package Pandora FMS
// modify it under the terms of the GNU General Public License * @subpackage Community
// as published by the Free Software Foundation for version 2. * @version 1.0.0
// This program is distributed in the hope that it will be useful, * @license See below
// but WITHOUT ANY WARRANTY; without even the implied warranty of *
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * ______ ___ _______ _______ ________
// GNU General Public License for more details. * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
// Load global variables * | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
global $config; global $config;
require_once 'include/functions_custom_graphs.php'; require_once 'include/functions_custom_graphs.php';
@ -99,8 +115,25 @@ $view_graph = (bool) get_parameter('view_graph');
$id = (int) get_parameter('id'); $id = (int) get_parameter('id');
$multiple_delete = (bool) get_parameter('multiple_delete', 0); $multiple_delete = (bool) get_parameter('multiple_delete', 0);
// Header // Header.
ui_print_page_header(__('Reporting').' &raquo; '.__('Custom graphs'), 'images/chart.png', false, '', false, $buttons); ui_print_standard_header(
__('List of custom graphs'),
'images/chart.png',
false,
'',
false,
$buttons,
[
[
'link' => '',
'label' => __('Reporting'),
],
[
'link' => '',
'label' => __('Custom graphs'),
],
]
);
// Delete module SQL code // Delete module SQL code
if ($delete_graph) { if ($delete_graph) {

View File

@ -1,16 +1,32 @@
<?php <?php
/**
* Map builder console.
*
* @category Topology maps
* @package Pandora FMS
* @subpackage Visual consoles
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2007-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com // Begin.
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config; global $config;
require_once $config['homedir'].'/include/functions_visual_map.php'; require_once $config['homedir'].'/include/functions_visual_map.php';
@ -32,9 +48,7 @@ if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) {
exit; exit;
} }
if ($is_metaconsole === false) {
if (!$is_metaconsole) {
$url_visual_console = 'index.php?sec=network&sec2=godmode/reporting/map_builder'; $url_visual_console = 'index.php?sec=network&sec2=godmode/reporting/map_builder';
$url_visual_console_favorite = 'index.php?sec=network&sec2=godmode/reporting/visual_console_favorite'; $url_visual_console_favorite = 'index.php?sec=network&sec2=godmode/reporting/visual_console_favorite';
$url_visual_console_template = 'index.php?sec=network&sec2=enterprise/godmode/reporting/visual_console_template'; $url_visual_console_template = 'index.php?sec=network&sec2=enterprise/godmode/reporting/visual_console_template';
@ -102,14 +116,24 @@ if ($is_enterprise !== ENTERPRISE_NOT_HOOK && $vconsoles_manage) {
]; ];
} }
if (!$is_metaconsole) { if ($is_metaconsole === false) {
ui_print_page_header( ui_print_standard_header(
__('Reporting').' &raquo; '.__('Visual Console'), __('Visual Console List'),
'images/op_reporting.png', 'images/op_reporting.png',
false, false,
'', '',
false, true,
$buttons $buttons,
[
[
'link' => '',
'label' => __('Topology maps'),
],
[
'link' => '',
'label' => __('Visual console'),
],
]
); );
} else { } else {
ui_meta_print_header( ui_meta_print_header(

View File

@ -62,6 +62,20 @@ $show_sort_options = [];
$show_sort_options[1] = __('Ascending'); $show_sort_options[1] = __('Ascending');
$show_sort_options[2] = __('Descending'); $show_sort_options[2] = __('Descending');
// Agents inventory display options.
$agents_inventory_display_options = [];
$agents_inventory_display_options['alias'] = __('Alias');
$agents_inventory_display_options['direccion'] = __('IP');
$agents_inventory_display_options['id_os'] = __('OS');
$agents_inventory_display_options['id_grupo'] = __('Group');
$agents_inventory_display_options['secondary_groups'] = __('Secondary groups');
$agents_inventory_display_options['comentarios'] = __('Description');
$agents_inventory_display_options['url_address'] = __('URL');
$agents_inventory_display_options['custom_fields'] = __('Custom fields');
$agents_inventory_display_options['estado'] = __('Status');
$agents_inventory_display_options['agent_version'] = __('Version');
$agents_inventory_display_options['remote'] = __('Remote configuration');
enterprise_include('/godmode/reporting/reporting_builder.item_editor.php'); enterprise_include('/godmode/reporting/reporting_builder.item_editor.php');
require_once $config['homedir'].'/include/functions_agents.php'; require_once $config['homedir'].'/include/functions_agents.php';
if (enterprise_include_once('include/functions_metaconsole.php')) { if (enterprise_include_once('include/functions_metaconsole.php')) {
@ -725,6 +739,25 @@ switch ($action) {
$idAgentModule = $module; $idAgentModule = $module;
break; break;
case 'agents_inventory':
$description = $item['description'];
$es = json_decode($item['external_source'], true);
$date = $es['date'];
$selected_agent_server_filter = $es['agent_server_filter'];
$selected_agent_group_filter = $es['agent_group_filter'];
$selected_agents_inventory_display_options = $es['agents_inventory_display_options'];
$selected_agent_os_filter = $es['agent_os_filter'];
$selected_agent_custom_field_filter = $es['agent_custom_field_filter'];
$selected_agent_status_filter = $es['agent_status_filter'];
$selected_agent_module_search_filter = $es['agent_module_search_filter'];
$selected_agent_version_filter = $es['agent_version_filter'];
$selected_agent_remote = $es['agent_remote_conf'];
$idAgent = $es['id_agents'];
$idAgentModule = $inventory_modules;
break;
case 'inventory': case 'inventory':
$description = $item['description']; $description = $item['description'];
$es = json_decode($item['external_source'], true); $es = json_decode($item['external_source'], true);
@ -3020,6 +3053,232 @@ $class = 'databox filters';
<td><?php html_print_checkbox_switch('pagebreak', 1, $pagebreak); ?></td> <td><?php html_print_checkbox_switch('pagebreak', 1, $pagebreak); ?></td>
</tr> </tr>
<tr id="row_agents_inventory_display_options" class="datos">
<td class="bolder">
<?php
echo __('Display options');
?>
</td>
<td>
<?php
html_print_select(
$agents_inventory_display_options,
'agents_inventory_display_options[]',
$selected_agents_inventory_display_options,
'',
'',
'',
false,
true,
true,
'',
false,
'width:200px'
);
?>
</td>
</tr>
<?php
$server_fields = [];
$server_fields[0] = __('All');
$servers = metaconsole_get_servers();
foreach ($servers as $key => $server) {
$server_fields[$key] = $server['server_name'];
}
$server_filter_markup = '
<tr id="row_agent_server_filter" class="datos">
<td class="bolder">'.__('Server').'</td><td>'.html_print_select(
$server_fields,
'agent_server_filter',
$selected_agent_server_filter,
'',
false,
'',
true,
false,
false,
'',
false,
'min-width: 180px'
).'</td></tr>';
if (is_metaconsole()) {
echo $server_filter_markup;
}
?>
<tr id="row_agent_group_filter" class="datos">
<td class="bolder">
<?php
echo __('Agent group filter');
?>
</td>
<td>
<?php
html_print_select_groups(
$config['id_user'],
'RW',
true,
'agent_group_filter',
$selected_agent_group_filter,
''
);
?>
</td>
</tr>
<tr id="row_os" class="datos">
<td class="bolder">
<?php
echo __('Agent OS filter');
?>
</td>
<td>
<?php
if ($selected_agent_os_filter === null) {
$selected_agent_os_filter = 0;
}
html_print_select_from_sql(
'SELECT id_os, name FROM tconfig_os',
'agent_os_filter[]',
$selected_agent_os_filter,
'',
__('All'),
'0',
false,
true
);
?>
</td>
</tr>
<tr id="row_custom_field" class="datos">
<td class="bolder">
<?php
echo __('Agent custom field filter');
?>
</td>
<td >
<?php
echo html_print_input_text(
'agent_custom_field_filter',
$selected_agent_custom_field_filter,
'',
50,
255,
true,
false,
false,
'',
'fullwidth'
);
?>
</td>
</tr>
<tr id="row_agent_status" class="datos">
<td class="bolder">
<?php
echo __('Agent status filter');
?>
</td>
<td>
<?php
$fields = [];
$fields[AGENT_STATUS_NORMAL] = __('Normal');
$fields[AGENT_STATUS_WARNING] = __('Warning');
$fields[AGENT_STATUS_CRITICAL] = __('Critical');
$fields[AGENT_STATUS_UNKNOWN] = __('Unknown');
$fields[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
$fields[AGENT_STATUS_NOT_INIT] = __('Not init');
if ($selected_agent_status_filter === null) {
$selected_agent_status_filter = -1;
}
html_print_select(
$fields,
'agent_status_filter[]',
$selected_agent_status_filter,
'',
__('All'),
'-1',
false,
true,
false,
'',
false,
'min-width: 180px'
);
?>
</td>
</tr>
<tr id="row_agent_version" class="datos">
<td class="bolder">
<?php
echo __('Agent version filter');
?>
</td>
<td >
<?php
echo html_print_input_text(
'agent_version_filter',
$selected_agent_version_filter,
'',
50,
255,
true,
false,
false,
'',
'fullwidth'
);
?>
</td>
</tr>
<tr id="row_agent_remote_conf" class="datos">
<td class="bolder">
<?php
echo __('Agent has remote configuration').ui_print_help_tip(
__('Filter agents by remote configuration enabled.'),
true
);
?>
</td>
<td><?php html_print_checkbox_switch('agent_remote_conf', 1, $selected_agent_remote); ?></td>
</tr>
<tr id="row_module_free_search" class="datos">
<td class="bolder">
<?php
echo __('Agent module filter');
?>
</td>
<td>
<?php
echo html_print_input_text(
'agent_module_search_filter',
$selected_agent_module_search_filter,
'',
50,
255,
true,
false,
false,
'',
'fullwidth'
);
?>
</td>
</tr>
</tbody> </tbody>
</table> </table>
@ -3326,6 +3585,9 @@ function print_SLA_list($width, $action, $idItem=null)
<input id="hidden-id_agent_sla" name="id_agent_sla" value="" type="hidden"> <input id="hidden-id_agent_sla" name="id_agent_sla" value="" type="hidden">
<input id="hidden-id_server" name="id_server" value="" type="hidden"> <input id="hidden-id_server" name="id_server" value="" type="hidden">
<?php <?php
// Set autocomplete image.
$autocompleteImage = html_print_image(($config['style'] === 'pandora_black') ? 'images/agent_mc.menu.png' : 'images/search_agent.png', true, false, true);
// Params for agent autocomplete input.
$params = []; $params = [];
$params['show_helptip'] = true; $params['show_helptip'] = true;
$params['input_name'] = 'agent_sla'; $params['input_name'] = 'agent_sla';
@ -3335,6 +3597,8 @@ function print_SLA_list($width, $action, $idItem=null)
$params['javascript_is_function_select'] = true; $params['javascript_is_function_select'] = true;
$params['selectbox_id'] = 'id_agent_module_sla'; $params['selectbox_id'] = 'id_agent_module_sla';
$params['add_none_module'] = false; $params['add_none_module'] = false;
$params['check_only_empty_javascript_on_blur_function'] = true;
$params['icon_image'] = $autocompleteImage;
if ($meta) { if ($meta) {
$params['use_input_id_server'] = true; $params['use_input_id_server'] = true;
$params['input_id_server_id'] = 'hidden-id_server'; $params['input_id_server_id'] = 'hidden-id_server';
@ -3370,6 +3634,7 @@ function print_SLA_list($width, $action, $idItem=null)
$params['javascript_is_function_select'] = true; $params['javascript_is_function_select'] = true;
$params['selectbox_id'] = 'id_agent_module_failover'; $params['selectbox_id'] = 'id_agent_module_failover';
$params['add_none_module'] = false; $params['add_none_module'] = false;
$params['icon_image'] = $autocompleteImage;
if ($meta) { if ($meta) {
$params['use_input_id_server'] = true; $params['use_input_id_server'] = true;
$params['input_id_server_id'] = 'hidden-id_server'; $params['input_id_server_id'] = 'hidden-id_server';
@ -4734,8 +4999,10 @@ function addSLARow() {
var serviceId = $("select#id_service>option:selected").val(); var serviceId = $("select#id_service>option:selected").val();
var serviceName = $("select#id_service>option:selected").text(); var serviceName = $("select#id_service>option:selected").text();
if (((idAgent != '') && (slaMin != '') && (slaMax != '') if ((((idAgent != '') && (idAgent > 0))
&& (slaLimit != '')) || serviceId != '') { && ((idModule != '') && (idModule > 0)))
|| serviceId != null)
{
if (nameAgent != '') { if (nameAgent != '') {
//Truncate nameAgent //Truncate nameAgent
var params = []; var params = [];
@ -4892,6 +5159,7 @@ function addSLARow() {
$("input[name=id_agent_failover]").val(''); $("input[name=id_agent_failover]").val('');
$("input[name=id_server]").val(''); $("input[name=id_server]").val('');
$("input[name=agent_sla]").val(''); $("input[name=agent_sla]").val('');
$("input[name=agent_sla]").css("background","url('<?php echo $autocompleteImage; ?>') right center no-repeat")
$("input[name=agent_failover]").val(''); $("input[name=agent_failover]").val('');
$("#id_agent_module_sla").empty(); $("#id_agent_module_sla").empty();
$("#id_agent_module_sla").attr('disabled', 'true'); $("#id_agent_module_sla").attr('disabled', 'true');
@ -5214,6 +5482,15 @@ function chooseType() {
$("#row_users").hide(); $("#row_users").hide();
$("#row_profiles_group").hide(); $("#row_profiles_group").hide();
$("#row_select_by_group").hide(); $("#row_select_by_group").hide();
$("#row_agents_inventory_display_options").hide();
$("#row_agent_server_filter").hide();
$("#row_agent_group_filter").hide();
$("#row_os").hide();
$("#row_custom_field").hide();
$("#row_agent_status").hide();
$("#row_agent_version").hide();
$("#row_agent_remote_conf").hide();
$("#row_module_free_search").hide();
// SLA list default state. // SLA list default state.
@ -5755,6 +6032,20 @@ function chooseType() {
break; break;
case 'agents_inventory':
$("#row_agents_inventory_display_options").show();
$("#row_agent_server_filter").show();
$("#row_agent_group_filter").show();
$("#row_group").show();
$("#row_os").show();
$("#row_custom_field").show();
$("#row_agent_status").show();
$("#row_agent_version").show();
$("#row_agent_remote_conf").show();
$("#row_module_free_search").show();
break;
case 'inventory': case 'inventory':
$("#row_description").show(); $("#row_description").show();
$("#row_group").show(); $("#row_group").show();

View File

@ -272,6 +272,8 @@ if ($idReport != 0) {
} }
} }
$helpers = ($helpers ?? '');
switch ($action) { switch ($action) {
case 'sort_items': case 'sort_items':
switch ($activeTab) { switch ($activeTab) {
@ -548,7 +550,7 @@ switch ($action) {
$subsection = $data_tab['subsection']; $subsection = $data_tab['subsection'];
$buttons = $data_tab['buttons']; $buttons = $data_tab['buttons'];
$helpers = $data_tab['helpers']; $helpers = $data_tab['helper'];
break; break;
} }
@ -567,17 +569,24 @@ switch ($action) {
// Print header. // Print header.
ui_meta_print_header(__('Reporting'), '', $buttons); ui_meta_print_header(__('Reporting'), '', $buttons);
} else { } else {
// Page header for normal console. // Header.
ui_print_page_header( ui_print_standard_header(
__('Custom reporting'), __('List of reports'),
'images/op_reporting.png', 'images/op_reporting.png',
false, false,
'', '',
false, false,
$buttons, $buttons,
false, [
'', [
60 'link' => '',
'label' => __('Reporting'),
],
[
'link' => '',
'label' => __('Custom reports'),
],
]
); );
} }
@ -2100,6 +2109,20 @@ switch ($action) {
$values['external_source'] = json_encode($es); $values['external_source'] = json_encode($es);
break; break;
case 'agents_inventory':
$es['agent_server_filter'] = get_parameter('agent_server_filter');
$es['agents_inventory_display_options'] = get_parameter('agents_inventory_display_options');
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
$es['agent_os_filter'] = get_parameter('agent_os_filter');
$es['agent_status_filter'] = get_parameter('agent_status_filter');
$es['agent_version_filter'] = get_parameter('agent_version_filter');
$es['agent_module_search_filter'] = get_parameter('agent_module_search_filter');
$es['agent_group_filter'] = get_parameter('agent_group_filter');
$es['agent_remote_conf'] = get_parameter('agent_remote_conf');
$values['external_source'] = json_encode($es);
break;
default: default:
// Default. // Default.
break; break;
@ -2486,7 +2509,7 @@ switch ($action) {
0 0
); );
$values['exception_condition'] = (int) get_parameter( $values['exception_condition'] = (int) get_parameter(
'radiobutton_exception_condition', 'exception_condition',
0 0
); );
$values['exception_condition_value'] = get_parameter( $values['exception_condition_value'] = get_parameter(
@ -2725,6 +2748,20 @@ switch ($action) {
$values['external_source'] = json_encode($es); $values['external_source'] = json_encode($es);
break; break;
case 'agents_inventory':
$es['agent_server_filter'] = get_parameter('agent_server_filter');
$es['agents_inventory_display_options'] = get_parameter('agents_inventory_display_options');
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
$es['agent_os_filter'] = get_parameter('agent_os_filter');
$es['agent_status_filter'] = get_parameter('agent_status_filter');
$es['agent_version_filter'] = get_parameter('agent_version_filter');
$es['agent_module_search_filter'] = get_parameter('agent_module_search_filter');
$es['agent_group_filter'] = get_parameter('agent_group_filter');
$es['agent_remote_conf'] = get_parameter('agent_remote_conf');
$values['external_source'] = json_encode($es);
break;
default: default:
// Default. // Default.
break; break;
@ -3145,17 +3182,24 @@ switch ($action) {
// Print header. // Print header.
ui_meta_print_header(__('Reporting'), '', $buttons); ui_meta_print_header(__('Reporting'), '', $buttons);
} else { } else {
// Page header for normal console. // Header.
ui_print_page_header( ui_print_standard_header(
$subsection, $subsection,
'images/op_reporting.png', 'images/op_reporting.png',
false, false,
'', '',
false, false,
$buttons, $buttons,
false, [
'', [
60 'link' => '',
'label' => __('Reporting'),
],
[
'link' => '',
'label' => __('Custom reports'),
],
]
); );
} }
@ -3209,7 +3253,7 @@ if ($enterpriseEnable) {
$buttons['view'] = [ $buttons['view'] = [
'active' => false, 'active' => false,
'text' => '<a href="index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id='.$idReport.'&pure='.$pure.'">'.html_print_image( 'text' => '<a href="index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id='.$idReport.'&pure='.$pure.'">'.html_print_image(
'images/operation.png', 'images/eye.png',
true, true,
[ [
'title' => __('View report'), 'title' => __('View report'),
@ -3251,17 +3295,25 @@ if ($enterpriseEnable && defined('METACONSOLE')) {
} else { } else {
$tab_builder = ($activeTab === 'item_editor') ? 'reporting_item_editor_tab' : ''; $tab_builder = ($activeTab === 'item_editor') ? 'reporting_item_editor_tab' : '';
if ($action !== 'update' && !is_metaconsole()) { if ($action !== 'update' && is_metaconsole() === false) {
ui_print_page_header( // Header.
ui_print_standard_header(
$textReportName, $textReportName,
'images/op_reporting.png', 'images/op_reporting.png',
false, false,
$tab_builder, $tab_builder,
false, false,
$buttons, $buttons,
false, [
'', [
60 'link' => '',
'label' => __('Reporting'),
],
[
'link' => '',
'label' => __('Custom reports'),
],
]
); );
} }
} }
@ -3291,17 +3343,25 @@ if ($resultOperationDB !== null) {
$activeTab = 'list_items'; $activeTab = 'list_items';
$buttons[$activeTab]['active'] = true; $buttons[$activeTab]['active'] = true;
if (!is_metaconsole()) { if (is_metaconsole() === false) {
ui_print_page_header( // Header.
ui_print_standard_header(
$textReportName, $textReportName,
'images/op_reporting.png', 'images/op_reporting.png',
false, false,
$helpers, $helpers,
false, false,
$buttons, $buttons,
false, [
'', [
60 'link' => '',
'label' => __('Reporting'),
],
[
'link' => '',
'label' => __('Custom reports'),
],
]
); );
} }
} }

View File

@ -1,19 +1,38 @@
<?php <?php
// Pandora FMS - http://pandorafms.com /**
// ================================================== * Extension to manage a list of gateways and the node address where they should
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas * point to.
// Please see http://pandorafms.org for full contribution list *
// This program is free software; you can redistribute it and/or * @category Extensions
// modify it under the terms of the GNU General Public License * @package Pandora FMS
// as published by the Free Software Foundation for version 2. * @subpackage Community
// This program is distributed in the hope that it will be useful, * @version 1.0.0
// but WITHOUT ANY WARRANTY; without even the implied warranty of * @license See below
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
// GNU General Public License for more details. * ______ ___ _______ _______ ________
// Login check * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
global $config; global $config;
global $statusProcessInDB; global $statusProcessInDB;
use PandoraFMS\User;
check_login(); check_login();
require_once $config['homedir'].'/include/functions_visual_map.php'; require_once $config['homedir'].'/include/functions_visual_map.php';
@ -753,8 +772,8 @@ if (!defined('METACONSOLE')) {
$url_view = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&pure=0&id_visualmap='.$idVisualConsole.'&refr='.$view_refresh; $url_view = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&pure=0&id_visualmap='.$idVisualConsole.'&refr='.$view_refresh;
} }
// Hash for auto-auth in public link // Hash for auto-auth in public link.
$hash = md5($config['dbpass'].$idVisualConsole.$config['id_user']); $hash = User::generatePublicHash();
$buttons = []; $buttons = [];
@ -810,14 +829,25 @@ $buttons[$activeTab]['active'] = true;
$tab_builder = ($activeTab === 'editor') ? 'visual_console_editor_editor_tab' : ''; $tab_builder = ($activeTab === 'editor') ? 'visual_console_editor_editor_tab' : '';
if (!defined('METACONSOLE')) { if (is_metaconsole() === false) {
ui_print_page_header( // Header.
ui_print_standard_header(
$visualConsoleName, $visualConsoleName,
'images/visual_console.png', 'images/visual_console.png',
false, false,
$tab_builder, $tab_builder,
false, false,
$buttons $buttons,
[
[
'link' => '',
'label' => __('Topology maps'),
],
[
'link' => '',
'label' => __('Visual console'),
],
]
); );
} }

View File

@ -211,26 +211,6 @@ $fonts = [
'196pt' => '196pt', '196pt' => '196pt',
]; ];
/*
$fontf = array('andale mono,times' => 'Andale Mono',
'arial,helvetica,sans-serif' => 'Arial',
'arial black,avant garde' => 'Arial Black',
'comic sans ms,sans-serif' => 'Comic Sans MS',
'courier new,courier' => 'Courier New',
'georgia,palatino' => 'Georgia',
'helvetica,impact' => 'Helvetica',
'impact,chicago' => 'Impact',
'symbol' => 'Symbol',
'tahoma,arial,helvetica,sans-serif' => 'Tahoma',
'terminal,monaco' => 'Terminal',
'times new roman,times' => 'Times New Roman',
'trebuchet ms,geneva' => 'Trebuchet MS',
'verdana,geneva' => 'Verdana',
'Webdings' => 'Webdings',
'Wingdings' => 'Wingdings'
);
*/
$table->rowstyle['all_9'] = 'display: none;'; $table->rowstyle['all_9'] = 'display: none;';
$table->data['all_9'][0] = __('Font'); $table->data['all_9'][0] = __('Font');
$table->colspan['all_9'][1] = '3'; $table->colspan['all_9'][1] = '3';

View File

@ -1,19 +1,38 @@
<?php <?php
// Pandora FMS - http://pandorafms.com /**
// ================================================== * Favorite visual console.
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas *
// Please see http://pandorafms.org for full contribution list * @category Topology maps
// This program is free software; you can redistribute it and/or * @package Pandora FMS
// modify it under the terms of the GNU General Public License * @subpackage Visual consoles
// as published by the Free Software Foundation for version 2. * @version 1.0.0
// This program is distributed in the hope that it will be useful, * @license See below
// but WITHOUT ANY WARRANTY; without even the implied warranty of *
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * ______ ___ _______ _______ ________
// GNU General Public License for more details. * | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2007-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
global $config; global $config;
require_once $config['homedir'].'/include/functions_visual_map.php'; require_once $config['homedir'].'/include/functions_visual_map.php';
// Breadcrumb.
require_once $config['homedir'].'/include/class/HTML.class.php';
ui_require_css_file('discovery');
// ACL for the general permission // ACL for the general permission
$vconsoles_read = check_acl($config['id_user'], 0, 'VR'); $vconsoles_read = check_acl($config['id_user'], 0, 'VR');
$vconsoles_write = check_acl($config['id_user'], 0, 'VW'); $vconsoles_write = check_acl($config['id_user'], 0, 'VW');
@ -32,7 +51,7 @@ if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) {
} }
if (!$is_metaconsole) { if ($is_metaconsole === false) {
$url_visual_console = 'index.php?sec=network&sec2=godmode/reporting/map_builder'; $url_visual_console = 'index.php?sec=network&sec2=godmode/reporting/map_builder';
$url_visual_console_favorite = 'index.php?sec=network&sec2=godmode/reporting/visual_console_favorite'; $url_visual_console_favorite = 'index.php?sec=network&sec2=godmode/reporting/visual_console_favorite';
$url_visual_console_template = 'index.php?sec=network&sec2=enterprise/godmode/reporting/visual_console_template'; $url_visual_console_template = 'index.php?sec=network&sec2=enterprise/godmode/reporting/visual_console_template';
@ -94,14 +113,24 @@ if ($is_enterprise !== ENTERPRISE_NOT_HOOK && $vconsoles_manage) {
]; ];
} }
if (!$is_metaconsole) { if ($is_metaconsole === false) {
ui_print_page_header( ui_print_standard_header(
__('Reporting').' &raquo; '.__('Visual Favourite Console'), __('Favourite Visual Console'),
'images/op_reporting.png', 'images/op_reporting.png',
false, false,
'', '',
false, true,
$buttons $buttons,
[
[
'link' => '',
'label' => __('Topology maps'),
],
[
'link' => '',
'label' => __('Visual console'),
],
]
); );
} else { } else {
ui_meta_print_header( ui_meta_print_header(

View File

@ -386,10 +386,10 @@ function check_process (id_server) {
parameters, parameters,
function (data) { function (data) {
if (data['correct']) { if (data['correct']) {
$("#check_exec_server img").attr("src", <?php echo 'images/dot_green.png'; ?>); $("#check_exec_server img").attr("src", "images/dot_green.png");
} }
else { else {
$("#check_exec_server img").attr("src", <?php echo 'images/dot_red.png'; ?>); $("#check_exec_server img").attr("src", "images/dot_red.png");
$("#check_error_message").empty(); $("#check_error_message").empty();
$("#check_error_message").append("<span>" + data['message'] + "</span>"); $("#check_error_message").append("<span>" + data['message'] + "</span>");
} }

View File

@ -1,17 +1,32 @@
<?php <?php
/**
* Images File Manager
*
* @category File manager
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com // Get global data.
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Load global vars
global $config; global $config;
check_login(); check_login();
@ -24,41 +39,33 @@ if (! check_acl($config['id_user'], 0, 'PM')) {
require_once 'include/functions_filemanager.php'; require_once 'include/functions_filemanager.php';
// Header // Header.
ui_print_page_header(__('File manager'), '', false, '', true); ui_print_page_header(__('File manager'), '', false, '', true);
if (isset($config['filemanager']['message'])) { if (isset($config['filemanager']['message']) === true) {
echo $config['filemanager']['message']; echo $config['filemanager']['message'];
$config['filemanager']['message'] = null; $config['filemanager']['message'] = null;
} }
$directory = (string) get_parameter('directory', '/'); $directory = (string) get_parameter('directory');
$directory = str_replace('\\', '/', $directory); if (empty($directory) === true) {
// A miminal security check to avoid directory traversal
if (preg_match('/\.\./', $directory)) {
$directory = 'images'; $directory = 'images';
} else {
$directory = str_replace('\\', '/', $directory);
$directory = filemanager_safe_directory($directory, 'images');
} }
if (preg_match('/^\//', $directory)) { // Add custom directories here.
$directory = 'images';
}
if (preg_match('/^manager/', $directory)) {
$directory = 'images';
}
// Add custom directories here
$fallback_directory = 'images'; $fallback_directory = 'images';
// Banned directories.
$banned_directories['include'] = true; $banned_directories['include'] = true;
$banned_directories['godmode'] = true; $banned_directories['godmode'] = true;
$banned_directories['operation'] = true; $banned_directories['operation'] = true;
$banned_directories['reporting'] = true; $banned_directories['reporting'] = true;
$banned_directories['general'] = true; $banned_directories['general'] = true;
$banned_directories[ENTERPRISE_DIR] = true; $banned_directories[ENTERPRISE_DIR] = true;
if (isset($banned_directories[$directory])) { if (isset($banned_directories[$directory]) === true) {
$directory = $fallback_directory; $directory = $fallback_directory;
} }
@ -67,15 +74,15 @@ $real_directory = realpath($config['homedir'].'/'.$directory);
echo '<h4>'.__('Index of %s', $directory).'</h4>'; echo '<h4>'.__('Index of %s', $directory).'</h4>';
$upload_file_or_zip = (bool) get_parameter('upload_file_or_zip'); $upload_file_or_zip = (bool) get_parameter('upload_file_or_zip');
$create_text_file = (bool) get_parameter('create_text_file'); $create_text_file = (bool) get_parameter('create_text_file');
$default_real_directory = realpath($config['homedir'].'/'.$fallback_directory); $default_real_directory = realpath($config['homedir'].'/'.$fallback_directory);
if ($upload_file_or_zip) { if ($upload_file_or_zip === true) {
upload_file($upload_file_or_zip, $default_real_directory); upload_file($upload_file_or_zip, $default_real_directory);
} }
if ($create_text_file) { if ($create_text_file === true) {
create_text_file($default_real_directory); create_text_file($default_real_directory);
} }

Some files were not shown because too many files have changed in this diff Show More