Merge branch '1730-missed-enterprise-plugins' into 'develop'
Fixed some default values in PluginTools See merge request artica/pandorafms!1239
This commit is contained in:
commit
2af1b628a8
|
@ -64,7 +64,8 @@ $PANDHOME_ENT/pandora_plugins/Nutanix/pandora_nutanix.pl \
|
|||
$PANDHOME_ENT/pandora_plugins/MTL/pandora_mtl.pl \
|
||||
$PANDHOME_ENT/pandora_plugins/Informix/informix.pl \
|
||||
$PANDHOME_ENT/pandora_plugins/Ruckus/ruckus.pl \
|
||||
$PANDHOME_ENT/pandora_server/util/plugins/vmware-plugin.pl"
|
||||
$PANDHOME_ENT/pandora_plugins/UX/pandora_ux.pl \
|
||||
$PANDHOME_ENT/pandora_server/util/plugins/vmware-plugin.pl "
|
||||
PLUGIN_LIB_FILE="$CODEHOME/pandora_server/lib/PandoraFMS/PluginTools.pm"
|
||||
|
||||
# Update version in spec files
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ $# -ne 1 ]
|
||||
then
|
||||
echo
|
||||
echo "Usage: domain_expiration_date.sh <domain_name>"
|
||||
echo "Returns the number of days to expiration date"
|
||||
echo
|
||||
exit
|
||||
fi
|
||||
|
||||
domain=$1
|
||||
|
||||
# Calculate days until expiration
|
||||
expiration=`whois $domain |grep "Expiry Date:"| awk -F"Date:" '{print $2}'|cut -f 1`
|
||||
expseconds=`date +%s --date="$expiration"`
|
||||
nowseconds=`date +%s`
|
||||
((diffseconds=expseconds-nowseconds))
|
||||
expdays=$((diffseconds/86400))
|
||||
|
||||
echo $expdays
|
||||
|
|
@ -9,12 +9,6 @@ package PandoraFMS::PluginTools;
|
|||
# Library Centos package
|
||||
# ------- --------------
|
||||
# LWP::UserAgent perl-libwww-perl
|
||||
#
|
||||
#
|
||||
#
|
||||
# Version Date
|
||||
# a1 17-11-2015
|
||||
# ** Revision handler in gitlab **
|
||||
#
|
||||
################################################################################
|
||||
|
||||
|
@ -58,6 +52,7 @@ our @EXPORT = qw(
|
|||
get_unit
|
||||
get_unix_time
|
||||
get_sys_environment
|
||||
get_current_utime_milis
|
||||
getCurrentUTimeMilis
|
||||
head
|
||||
in_array
|
||||
|
@ -100,6 +95,7 @@ sub get_lib_version {
|
|||
################################################################################
|
||||
# Get current time (milis)
|
||||
################################################################################
|
||||
sub get_current_utime_milis { return getCurrentUTimeMilis(); }
|
||||
sub getCurrentUTimeMilis {
|
||||
#return trim (`date +"%s%3N"`); # returns 1449681679712
|
||||
return floor(time*1000);
|
||||
|
@ -609,7 +605,11 @@ sub transfer_xml {
|
|||
|
||||
close (FD);
|
||||
|
||||
# Reassign default values if not present
|
||||
$conf->{tentacle_client} = "tentacle_client" if empty($conf->{tentacle_client});
|
||||
$conf->{tentacle_port} = "44121" if empty($conf->{tentacle_port});
|
||||
$conf->{mode} = $conf->{transfer_mode} if empty($conf->{mode});
|
||||
|
||||
if (empty ($conf->{mode}) ) {
|
||||
print_stderror($conf, "[ERROR] Nor \"mode\" nor \"transfer_mode\" defined in configuration.");
|
||||
return undef;
|
||||
|
|
|
@ -206,7 +206,7 @@ if ($module eq "diskuse") {
|
|||
$command_line_parammeters = "-v $version -c $community $host";
|
||||
}
|
||||
|
||||
if ($disk =~ /\\/) {
|
||||
if ($disk =~ /\\ /) {
|
||||
$disk =~ s/\\/\\\\/g;
|
||||
}
|
||||
my $diskid = `snmpwalk -r 2 -On $command_line_parammeters .1.3.6.1.2.1.25.2.3.1.3 | grep -F '$disk' | head -1 | gawk '{print \$1}' | gawk -F "." '{print \$13}' | tr -d "\r"`;
|
||||
|
@ -248,9 +248,11 @@ if ($module eq "process") {
|
|||
$command_line_parammeters = "-v $version -c $community $host";
|
||||
}
|
||||
|
||||
$status = `snmpwalk $command_line_parammeters 1.3.6.1.2.1.25.4.2.1.2 | grep "$process" | head -1 | wc -l`;
|
||||
|
||||
print $status;
|
||||
$status = `snmpwalk $command_line_parammeters 1.3.6.1.2.1.25.4.2.1.2 2>/dev/null`;
|
||||
|
||||
if ($? == 0) {
|
||||
print (($status =~ m/$process/mi)?1:0);
|
||||
}
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue