From e133943f70ff24b5a77d231f578eef2b6f009e02 Mon Sep 17 00:00:00 2001 From: slerena Date: Thu, 2 Apr 2009 18:58:25 +0000 Subject: [PATCH] 2009-04-02 Sancho Lerena * DB.pm: Function to process SNMP Alerts was not properly exported, so SNMP alerts in some environments don't run. Fixed (this is ok in 2.1). * util/udp_client.pl: Client to connect with pandora windows agent mini server and using with alerts to manage remote process / services in Windows * util/mcast_client.pl: Tool to check the UDP multicast notification service of Pandora. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1593 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 11 +++++++++++ pandora_server/lib/PandoraFMS/DB.pm | 3 ++- pandora_server/util/mcast_client.pl | 24 ++++++++++++++++++++++++ pandora_server/util/udp_client.pl | 14 ++++++++++++++ 4 files changed, 51 insertions(+), 1 deletion(-) create mode 100755 pandora_server/util/mcast_client.pl create mode 100755 pandora_server/util/udp_client.pl diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 1369c34b1b..d35d5b75fa 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,14 @@ +2009-04-02 Sancho Lerena + + * DB.pm: Function to process SNMP Alerts was not properly exported, so + SNMP alerts in some environments don't run. Fixed (this is ok in 2.1). + + * util/udp_client.pl: Client to connect with pandora windows agent mini + server and using with alerts to manage remote process / services in Windows + + * util/mcast_client.pl: Tool to check the UDP multicast notification + service of Pandora. + 2009-03-26 Evi Vanoost * lib/PandoraFMS/Tools.pm: Added Apple to the detected OS'es diff --git a/pandora_server/lib/PandoraFMS/DB.pm b/pandora_server/lib/PandoraFMS/DB.pm index 0954303b38..527d99e398 100644 --- a/pandora_server/lib/PandoraFMS/DB.pm +++ b/pandora_server/lib/PandoraFMS/DB.pm @@ -37,7 +37,8 @@ require Exporter; our @ISA = ("Exporter"); our %EXPORT_TAGS = ( 'all' => [ qw( ) ] ); our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); -our @EXPORT = qw( +our @EXPORT = qw( + calcula_alerta_snmp crea_agente_modulo update_on_error dame_server_id diff --git a/pandora_server/util/mcast_client.pl b/pandora_server/util/mcast_client.pl new file mode 100755 index 0000000000..3f82e6f8d6 --- /dev/null +++ b/pandora_server/util/mcast_client.pl @@ -0,0 +1,24 @@ +#!/usr/bin/perl +# Multicast client + +use strict; +use IO::Socket::Multicast; + +if ($#ARGV != 1) { + print "Usage: $0 \n"; + exit 1; +} + +my $group = $ARGV[0]; +my $port = $ARGV[1]; + +my $sock = IO::Socket::Multicast->new(Proto=>'udp',LocalPort=>$port); +$sock->mcast_add($group) || die "Couldn't set group: $!\n"; + +print "Press ctr-c to quit\n"; + +while (1) { + my $data; + next unless $sock->recv($data,1024); + print $data; +} diff --git a/pandora_server/util/udp_client.pl b/pandora_server/util/udp_client.pl new file mode 100755 index 0000000000..23ff6cb023 --- /dev/null +++ b/pandora_server/util/udp_client.pl @@ -0,0 +1,14 @@ +#!/usr/bin/perl + +use strict; +use IO::Socket; + +if ($#ARGV != 2) { + die "Usage: $0
"; +} + +my $socket = new IO::Socket::INET(Proto => "udp", + PeerAddr => $ARGV[0], + PeerPort => $ARGV[1]) || die "[error] Connect error: $@"; + +$socket->send ($ARGV[2]) || die "[error] Send error: $@";