Merge remote-tracking branch 'origin/develop' into ent-9586-acls-en-llamada-a-funcion-get_tree_agent-de-la-api

This commit is contained in:
Luis 2022-12-14 16:25:36 +01:00
commit 7716157b8d
326 changed files with 87104 additions and 88137 deletions

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
*.exe filter=lfs diff=lfs merge=lfs -text

View File

@ -170,7 +170,7 @@ http://rpms.remirepo.net/enterprise/remi-release-7.rpm \
https://repo.percona.com/yum/percona-release-latest.noarch.rpm"
execute_cmd "yum install -y $extra_repos" "Installing extra repositories"
execute_cmd "yum-config-manager --enable remi-php74" "Configuring PHP"
execute_cmd "yum-config-manager --enable remi-php80" "Configuring PHP"
# Install percona Database
#[ -f /etc/my.cnf ] && rm -rf /etc/my.cnf

View File

@ -20,7 +20,7 @@ LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
# define default variables
[ "$TZ" ] || TZ="Europe/Madrid"
[ "$MYVER" ] || MYVER=57
[ "$PHPVER" ] || PHPVER=7
[ "$PHPVER" ] || PHPVER=8
[ "$DBHOST" ] || DBHOST=127.0.0.1
[ "$DBNAME" ] || DBNAME=pandora
[ "$DBUSER" ] || DBUSER=pandora

View File

@ -21,7 +21,7 @@ LOGFILE="/tmp/pandora-deploy-community-$(date +%F).log"
# define default variables
[ "$TZ" ] || TZ="Europe/Madrid"
[ "$PHPVER" ] || PHPVER=7.4
[ "$PHPVER" ] || PHPVER=8.0
[ "$DBHOST" ] || DBHOST=127.0.0.1
[ "$DBNAME" ] || DBNAME=pandora
[ "$DBUSER" ] || DBUSER=pandora
@ -138,6 +138,9 @@ check_root_permissions
# Connectivity
check_repo_connection
#Install awk, sed, grep if not present
execute_cmd "apt install -y gawk sed grep" 'Installing needed tools'
# Systemd
execute_cmd "systemctl --version" "Checking SystemD" 'This is not a SystemD enable system, if tryng to use in a docker env please check: https://github.com/pandorafms/pandorafms/tree/develop/extras/docker/centos8'
@ -155,7 +158,7 @@ execute_cmd "timedatectl set-timezone $TZ" "Setting Timezone $TZ"
execute_cmd "awk --version" 'Checking needed tools: awk'
execute_cmd "grep --version" 'Checking needed tools: grep'
execute_cmd "sed --version" 'Checking needed tools: sed'
execute_cmd "apt --version" 'Checking needed tools: dnf'
execute_cmd "apt --version" 'Checking needed tools: apt'
# Creating working directory
rm -rf "$WORKDIR" &>> "$LOGFILE"

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

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

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2021 Artica Soluciones Tecnologicas
# Version 7.0NG.765
# Version 7.0NG.767
# 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
# Foundation; either version 2 of the Licence or any later version

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -5,7 +5,7 @@
# Tentacle have IANA assigned port tpc/41121 as official port.
##########################################################################
# Copyright (c) 2007-2008 Ramon Novoa <rnovoa@artica.es>
# Copyright (c) 2005-2010 Artica Soluciones Tecnologicas S.L
# Copyright (c) 2005-2022 Artica Soluciones Tecnologicas S.L
#
# tentacle_server.pl Tentacle Server. See https://pandorafms.com/docs/ for
# protocol description.
@ -1740,6 +1740,19 @@ sub callback_stop {
Win32::Daemon::StopService();
}
################################################################################
## SUB check_ssleay_version
## Print a message if the installed version of Net::SSLeay may leak memory.
################################################################################
sub check_ssleay_version {
eval {
require Net::SSLeay;
return unless defined($Net::SSLeay::VERSION) && $Net::SSLeay::VERSION =~ m/^(\d+)\.(\d+)/ && $1 <= 1 && $2 < 88;
print_log ("Net::SSLeay version $Net::SSLeay::VERSION detected. Versions prior to 1.88 may leak memory. To upgrade it see: https://metacpan.org/pod/Net::SSLeay");
};
}
################################################################################
# Main
################################################################################
@ -1753,12 +1766,20 @@ if ($> == 0 && $^O ne 'MSWin32') {
# Parse command line options
parse_options ();
# Try to open the log file.
if (defined($log_file)) {
open(my $fh, ">>", $log_file) || die("Error opening the log file '$log_file': $!.\n");
close($fh);
}
# Check command line arguments
if ($#ARGV != -1) {
print_help ();
exit 1;
}
check_ssleay_version() if $t_ssl == 1;
# Show IPv6 status
if ($SOCKET_MODULE eq 'IO::Socket::INET') {
print_log ("IO::Socket::INET6 is not found. IPv6 is disabled.");

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.765-221024
Version: 7.0NG.767-221214
Architecture: all
Priority: optional
Section: admin

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

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

View File

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

View File

@ -1014,8 +1014,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.765';
use constant AGENT_BUILD => '221024';
use constant AGENT_VERSION => '7.0NG.767';
use constant AGENT_BUILD => '221214';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;
@ -2403,6 +2403,11 @@ sub check_collections () {
if (open (MD5_FILE, "< $ConfDir/collections/$collection_md5_file")) {
$local_collection_md5 = <MD5_FILE>;
close MD5_FILE;
if ( ! defined ($local_collection_md5) ) {
log_message ('Collection', "Size of $ConfDir/collections/$collection_md5_file is 0");
unlink ("$ConfDir/collections/$collection_md5_file");
$local_collection_md5 = "Size 0";
}
} else {
log_message ('Collection', "Could not open dir $ConfDir/collections/$collection_md5_file");
next;

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.765
%define release 221024
%define version 7.0NG.767
%define release 221214
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.765
%define release 221024
%define version 7.0NG.767
%define release 221214
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -9,8 +9,8 @@
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
# **********************************************************************
PI_VERSION="7.0NG.765"
PI_BUILD="221024"
PI_VERSION="7.0NG.767"
PI_BUILD="221214"
OS_NAME=`uname -s`
FORCE=0

View File

@ -12,32 +12,34 @@
#
###################################################
from sys import argv
from sys import path
from sys import stderr
from sys import exit
from subprocess import Popen
from subprocess import PIPE
from subprocess import DEVNULL
from subprocess import getstatusoutput
import psutil
try:
from sys import argv
from sys import stderr
from sys import exit
from subprocess import Popen
from subprocess import PIPE
from subprocess import DEVNULL
from subprocess import getstatusoutput
import psutil
except ModuleNotFoundError as err:
print("{} error: {}. Exiting...".format(argv[0], err), file=stderr)
exit(1)
global module_list
module_list = []
version = "1.1"
VERSION = "1.2"
#########################################################################################
# Powershell class
#########################################################################################
class PSCheck:
@staticmethod
@staticmethod
def check_service(servicename, option=False, memcpu=False):
"""Check services with powershell by parsing their DisplayName. Returns a dict\
list with the name of the service and a boolean with its status.\n
list with the name of the service and a boolean with its status.\n
Requires service name (case insensitive)."""
pscall = Popen(["powershell", "Get-Service", "-Name", "'*"+ str(servicename) + "*'",
"|", "Select-Object", "-ExpandProperty", "Name"],
"|", "Select-Object", "-ExpandProperty", "Name"],
stdout=PIPE, stdin=DEVNULL, stderr=DEVNULL, universal_newlines=True)
result = pscall.communicate()
result = str(result[0]).strip().split("\n")
@ -50,15 +52,15 @@ class PSCheck:
procname = PSCheck.get_serviceprocess(element)
# Get process status
parstatus = PSCheck.getstatus(element)
if memcpu == True and parstatus == 1:
if memcpu and parstatus == 1:
usage = get_memcpu(str(procname), str(element))
output += usage
# Generate module with name and status
parent = service_module(str(element), parstatus)
output += parent
if option == True:
if option:
children = PSCheck.getchildren(element, memcpu)
if type(children) == list and len(children) > 1:
if isinstance(children, list) and len(children) > 1:
for child in children:
output += child
else:
@ -66,7 +68,6 @@ class PSCheck:
else:
next
#if output != '':
if output and element and procname:
return ({"name" : element, "process" : procname, "modules": output})
else:
@ -84,22 +85,22 @@ class PSCheck:
status = PSCheck.getstatus(child)
kids += service_module(str(child), status, "Service " + str(servicename) + " - Status")
if status:
if memcpu == True:
if memcpu:
kidsusage = get_memcpu(str(child))
for usage in kidsusage:
kids += usage
else:
next
return (kids)
return kids
@staticmethod
def getstatus(servicename):
"""Gets the status of a given Windows service"""
running = Popen(["powershell", "Get-Service", "-Name '" + str(servicename) +
"' |", "Select-Object", "-ExpandProperty", "Status"],
stdout=PIPE, stdin=DEVNULL, stderr=DEVNULL, universal_newlines=True)
"' |", "Select-Object", "-ExpandProperty", "Status"],
stdout=PIPE, stdin=DEVNULL, stderr=DEVNULL, universal_newlines=True)
status = running.communicate()[0].strip()
return (int(status == "Running"))
return int(status == "Running")
@staticmethod
def get_serviceprocess(servicename):
@ -108,7 +109,7 @@ class PSCheck:
srv_pid = service.pid()
process = psutil.Process(srv_pid)
proc_name = process.name()
return (proc_name)
return proc_name
#########################################################################################
@ -124,13 +125,13 @@ def service_module(name, value, parent=None):
"module_parent" : parent,
}]
#print ("service_module END "+str(now(0,1)))
return (module)
return module
def get_memcpu (process, servicename):
def get_memcpu (process, servicename=None):
"""Creates a module for Memory and CPU for a given process. Returns a list of dictionaries."""
modules = []
if process:
if servicename != None:
if servicename is not None:
parentname = servicename
else:
parentname = process
@ -147,7 +148,7 @@ def get_memcpu (process, servicename):
"unit" : "%",
"module_parent" : "Service "+ parentname + " - Status",
}]
return (modules)
return modules
def proc_percentbyname(procname): ############# 03/03/2020
"""Gets Memory and CPU usage for a given process. Returns a list."""
@ -165,7 +166,7 @@ def proc_percentbyname(procname): ############# 03/03/2020
except psutil.NoSuchProcess:
next
#print ("proc_percentbyname END "+str(now(0,1)))
return ([sum(memory),sum(cpu)])
return [sum(memory),sum(cpu)]
def win_service(servicelist, option=False, memcpu=False):
"""Creates modules for Windows servers."""
@ -173,7 +174,7 @@ def win_service(servicelist, option=False, memcpu=False):
for srvc in servicelist:
if srvc and len(srvc) > 2:
output = PSCheck.check_service(srvc, option, memcpu)
if output != None and output["modules"]:
if output is not None and output["modules"]:
modules += PSCheck.check_service(srvc.strip(), option, memcpu)["modules"]
module_list.append(srvc)
#winprocess = output["name"]
@ -197,9 +198,9 @@ def lnx_service(services_list, memcpu=False):
if sysctl == 0:
### Systemd available
syscall = Popen(["systemctl", "show", "-pLoadState", "-pActiveState", srvc], stdout=PIPE,
stdin=DEVNULL, universal_newlines=True)
stdin=DEVNULL, universal_newlines=True)
result = syscall.communicate()
srvstatus= result[0].strip().lower().split("\n")
srvstatus = result[0].strip().lower().split("\n")
if srvstatus[0] == "loadstate=not-found":
next
else:
@ -212,7 +213,7 @@ def lnx_service(services_list, memcpu=False):
elif sysctl != 0 and servic == 0:
### Systemd not available, switch to service command
syscall = Popen(["service", srvc, "status"], stdout=PIPE,
stdin=DEVNULL, stderr=DEVNULL, universal_newlines=True)
stdin=DEVNULL, stderr=DEVNULL, universal_newlines=True)
result = syscall.communicate()[0].lower()
if "is running" in result:
modules += service_module(srvc, 1)
@ -223,15 +224,15 @@ def lnx_service(services_list, memcpu=False):
else:
next
else:
print ("No systemd or service commands available. Exiting...", file=stderr)
print("No systemd or service commands available. Exiting...", file=stderr)
exit()
if status:
module_list.append(srvc)
if memcpu == True:
if memcpu:
modules += get_memcpu(srvc, None)
for m in modules:
print_module (m, 1)
print_module(m, 1)
#########################################################################################
@ -339,7 +340,7 @@ def print_module(module, str_flag=False):
#### Print flag
if str_flag is not False:
print (module_xml)
print(module_xml)
return (module_xml)
@ -362,7 +363,7 @@ def main():
"postfix", "mysqld", "postgres", "oracle", "mongod"]
discover(OS, service_list)
else:
print ("OS not recognized. Exiting...", file=stderr)
print("OS not recognized. Exiting...", file=stderr)
exit()
def discover(osyst, servicelist):
@ -383,24 +384,24 @@ def discover(osyst, servicelist):
elif osyst == "Linux":
lnx_service(servicelist, memcpu)
else:
print ("\nPandora FMS Autodiscovery plugin v{}".format(version))
print ("Checks the status of the services in list and monitors CPU and Memory for each of them.\n")
print ("Usage:")
print ("{} [options] [--usage]".format(argv[0]))
print ("--help")
print ("\tPrints this help screen")
print ("--default")
print ("\tRuns this tool with default monitoring.")
print ("\tServices monitored by default for {}:".format(osyst))
print ("\t",", ".join(servicelist))
print ("--list \"<srvc1,srvc2,srvc3>\"")
print ("\tReplaces default services for a given list (comma-separated)")
print("\nPandora FMS Autodiscovery plugin v{}".format(VERSION))
print("Checks the status of the services in list and monitors CPU and Memory for each of them.\n")
print("Usage:")
print("{} [options] [--usage]".format(argv[0]))
print("--help")
print("\tPrints this help screen")
print("--default")
print("\tRuns this tool with default monitoring.")
print("\tServices monitored by default for {}:".format(osyst))
print("\t", ", ".join(servicelist))
print("--list \"<srvc1,srvc2,srvc3>\"")
print("\tReplaces default services for a given list (comma-separated)")
if osyst == "Windows":
print ("\tEach element of the list will be treated as a regexp, but they must be over 2 characters.")
print ("\tElements under 2 characters will be discarded.")
print ("--usage")
print ("\tAdds modules for CPU and Memory usage per service/process (optional, can take some time).\n")
print("\tEach element of the list will be treated as a regexp, but they must be over 2 characters.")
print("\tElements under 2 characters will be discarded.")
print("--usage")
print("\tAdds modules for CPU and Memory usage per service/process (optional, can take some time).\n")
##### RUN ####
main()
main()

View File

@ -5,7 +5,7 @@
# Tentacle have IANA assigned port tpc/41121 as official port.
##########################################################################
# Copyright (c) 2007-2008 Ramon Novoa <rnovoa@artica.es>
# Copyright (c) 2005-2010 Artica Soluciones Tecnologicas S.L
# Copyright (c) 2005-2022 Artica Soluciones Tecnologicas S.L
#
# tentacle_server.pl Tentacle Server. See https://pandorafms.com/docs/ for
# protocol description.
@ -1740,6 +1740,19 @@ sub callback_stop {
Win32::Daemon::StopService();
}
################################################################################
## SUB check_ssleay_version
## Print a message if the installed version of Net::SSLeay may leak memory.
################################################################################
sub check_ssleay_version {
eval {
require Net::SSLeay;
return unless defined($Net::SSLeay::VERSION) && $Net::SSLeay::VERSION =~ m/^(\d+)\.(\d+)/ && $1 <= 1 && $2 < 88;
print_log ("Net::SSLeay version $Net::SSLeay::VERSION detected. Versions prior to 1.88 may leak memory. To upgrade it see: https://metacpan.org/pod/Net::SSLeay");
};
}
################################################################################
# Main
################################################################################
@ -1753,12 +1766,20 @@ if ($> == 0 && $^O ne 'MSWin32') {
# Parse command line options
parse_options ();
# Try to open the log file.
if (defined($log_file)) {
open(my $fh, ">>", $log_file) || die("Error opening the log file '$log_file': $!.\n");
close($fh);
}
# Check command line arguments
if ($#ARGV != -1) {
print_help ();
exit 1;
}
check_ssleay_version() if $t_ssl == 1;
# Show IPv6 status
if ($SOCKET_MODULE eq 'IO::Socket::INET') {
print_log ("IO::Socket::INET6 is not found. IPv6 is disabled.");

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2021 Artica Soluciones Tecnologicas
# Version 7.0NG.765
# Version 7.0NG.767
# 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
# Foundation; either version 2 of the Licence or any later version

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