diff -ruBNx HTML /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20081227/CHANGES /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20090222/CHANGES
--- /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20081227/CHANGES 2008-12-27 12:10:32.000000000 -0500
+++ /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20090222/CHANGES 2009-02-22 17:43:59.000000000 -0500
@@ -1,6 +1,7 @@
* current
work around bug in some versions of mod_perl
+ TCP/Freeswitch
* Version 3.6 [2008 Oct 27]
SNMP interface auto-discovery (oid: ifInOctets[POS1/0])
diff -ruBNx HTML /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20081227/Makefile.tplt /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20090222/Makefile.tplt
--- /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20081227/Makefile.tplt 2008-12-27 12:10:15.000000000 -0500
+++ /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20090222/Makefile.tplt 2009-02-22 17:42:35.000000000 -0500
@@ -3,9 +3,9 @@
# Created: 2002-Jun-27
# Function: Makefile template
#
-# $Id: Makefile.tplt,v 1.182 2008/12/27 17:10:15 jaw Exp $
+# $Id: Makefile.tplt,v 1.183 2009/02/22 22:42:35 jaw Exp $
-VERSION = dev-20081227
+VERSION = dev-20090222
MESSAGE = This is unstable development code
INSTALL = please see the INSTALL document for the next steps
UPGRADE1 = be sure to install the new misc/argus.css and misc/argus.js files
@@ -36,7 +36,7 @@
Argus::SNMP.pm Argus::SNMP::Helper.pm DNS.pm DNS::UDP.pm DNS::TCP.pm Self.pm \
DataBase.pm SSL.pm Argus::Agent.pm \
Argus::SIP.pm Argus::SIP::TCP.pm Argus::SIP::UDP.pm Argus::Asterisk.pm \
- Argus::RPC.pm Argus::RPC::UDP.pm Argus::RPC::TCP.pm \
+ Argus::RPC.pm Argus::RPC::UDP.pm Argus::RPC::TCP.pm Argus::Freeswitch.pm \
Encoding::BER.pm Encoding::BER::SNMP.pm Argus::Compute.pm
# darp code
@@ -209,8 +209,8 @@
HTML/debug-details.html: $(BUILD)
built/argusd -EH > HTML/debug-details.html
-HTML/config-since34.html: $(BUILD)
- built/argusd -DHS 3.4 > HTML/config-since34.html
+HTML/config-since36.html: $(BUILD)
+ built/argusd -DHS 3.6 > HTML/config-since36.html
love:
diff -ruBNx HTML /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20081227/src/Argus::Freeswitch.pm /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20090222/src/Argus::Freeswitch.pm
--- /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20081227/src/Argus::Freeswitch.pm 1969-12-31 19:00:00.000000000 -0500
+++ /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20090222/src/Argus::Freeswitch.pm 2009-02-22 17:42:40.000000000 -0500
@@ -0,0 +1,90 @@
+# -*- perl -*-
+
+# Copyright (c) 2004 by Jeff Weisberg
+# Author: Jeff Weisberg
+# Created: 2004-Sep-27 21:54 (EDT)
+# Function: freeswitch pbx testing
+#
+# $Id: Argus::Freeswitch.pm,v 1.1 2009/02/22 22:42:40 jaw Exp $
+
+# send commands over freeswitch client interface
+# wiki.freeswitch.org/wiki/Mod_commands
+
+package Argus::Freeswitch;
+@ISA = qw(TCP);
+
+use strict qw(refs vars);
+use vars qw($doc @ISA);
+
+my $PORT = 8021;
+
+$doc = {
+ package => __PACKAGE__,
+ file => __FILE__,
+ isa => [qw(TCP Service MonEl BaseIO)],
+ methods => {},
+ versn => '3.7',
+ html => 'freeswitch',
+ fields => {
+ freesw::pass => {
+ descr => 'FreeSWITCH client password',
+ attrs => ['config', 'inherit'],
+ default => 'ClueCon',
+ },
+ freesw::cmd => {
+ descr => 'FreeSWITCH API Command',
+ attrs => ['config', 'inherit'],
+ },
+
+
+ },
+
+};
+
+
+sub probe {
+ my $name = shift;
+
+ return [14, \&config] if $name =~ /TCP\/Freeswitch/i;
+}
+
+
+sub config {
+ my $me = shift;
+ my $cf = shift;
+
+ bless $me;
+ $me->{tcp}{port} = $PORT; # possibly overridden by config
+ $me->{tcp}{readhow} = 'toeof';
+
+ $me->TCP::config($cf);
+ $me->init_from_config( $cf, $doc, 'freesw' );
+
+ $me->{tcp}{send} = join( "\r\n",
+ "auth $me->{freesw}{pass}", "",
+ ($me->{freesw}{cmd} ?
+ ( "api $me->{freesw}{cmd}", "" ) : ()),
+ "exit", "");
+
+ $me->{uname} = "Freeswitch_$me->{ip}{hostname}";
+ $me->{uname} .= "_$me->{freesw}{cmd}" if $me->{freesw}{cmd};
+ # ...
+
+
+ $me;
+}
+
+################################################################
+sub about_more {
+ my $me = shift;
+ my $ctl = shift;
+
+ $me->SUPER::about_more($ctl); # NB: SUPER = TCP
+ $me->more_about_whom($ctl, 'freesw');
+}
+
+################################################################
+Doc::register( $doc );
+push @Service::probes, \&probe;
+
+1;
diff -ruBNx HTML /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20081227/src/Conf.pm /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20090222/src/Conf.pm
--- /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20081227/src/Conf.pm 2008-07-28 19:19:26.000000000 -0400
+++ /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20090222/src/Conf.pm 2009-02-22 17:42:40.000000000 -0500
@@ -5,7 +5,7 @@
# Date: 2002-Apr-03 09:13 (EST)
# Function: config file reading
#
-# $Id: Conf.pm,v 1.64 2008/07/28 23:19:26 jaw Exp $
+# $Id: Conf.pm,v 1.65 2009/02/22 22:42:40 jaw Exp $
# some bozo put a Config.pm in the standard perl dist
package Conf;
@@ -140,7 +140,8 @@
if( -d $file && -r _ && -x _ ){
$me->{basedir} = $file; # includes will be relative to config dir
opendir D, $file;
- @files =
+ @files =
+ grep { ! /^CVS/ } # skip CVS
grep { !/^[\.\#]/ } # skip .file and #file
grep { !/(\.bkp|~)$/ } readdir D; # and file.bkp and file~
closedir D;
diff -ruBNx HTML /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20081227/src/Service.pm /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20090222/src/Service.pm
--- /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20081227/src/Service.pm 2008-10-25 12:34:53.000000000 -0400
+++ /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20090222/src/Service.pm 2009-02-22 17:42:41.000000000 -0500
@@ -5,7 +5,7 @@
# Date: 2002-Apr-03 08:56 (EST)
# Function: the service class
#
-# $Id: Service.pm,v 1.119 2008/10/25 16:34:53 jaw Exp $
+# $Id: Service.pm,v 1.120 2009/02/22 22:42:41 jaw Exp $
package Service;
@ISA = qw(MonEl BaseIO);
@@ -20,6 +20,9 @@
use Ping;
use Self;
use DataBase;
+use Argus::Agent;
+use Argus::Asterisk;
+use Argus::Freeswitch;
use Argus::Compute;
use Argus::Encode;
use Argus::Archive;
@@ -27,8 +30,6 @@
my $HAVE_MD5;
BEGIN {
# these may or may not be present
- eval { require Argus::Asterisk; }; # asterisk manager interface
- eval { require Argus::Agent; }; # remote system monitoring agent
eval { require Digest::MD5; $HAVE_MD5 = 1; };
}
diff -ruBNx HTML /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20081227/src/TCP.pm /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20090222/src/TCP.pm
--- /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20081227/src/TCP.pm 2008-07-28 19:19:27.000000000 -0400
+++ /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20090222/src/TCP.pm 2009-02-22 17:42:41.000000000 -0500
@@ -5,7 +5,7 @@
# Date: 2002-Apr-03 15:59 (EST)
# Function: testing of TCP services
#
-# $Id: TCP.pm,v 1.80 2008/07/28 23:19:27 jaw Exp $
+# $Id: TCP.pm,v 1.81 2009/02/22 22:42:41 jaw Exp $
package TCP;
@@ -136,7 +136,9 @@
},
SSH => {
- port => 22, expect => '^SSH', readhow => 'banner',
+ port => 22, readhow => 'banner',
+ send => "SSH-1.99-argus\r\n",
+ expect => '^SSH',
},
IMAP => {
diff -ruBNx HTML /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20081227/src/UDP.pm /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20090222/src/UDP.pm
--- /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20081227/src/UDP.pm 2008-07-28 19:19:27.000000000 -0400
+++ /home/hostedsites/www.jeremykister.com/data/argus/argus-dev-20090222/src/UDP.pm 2009-02-22 17:42:42.000000000 -0500
@@ -5,7 +5,7 @@
# Date: 2002-Apr-03 18:25 (EST)
# Function: testing of UDP services
#
-# $Id: UDP.pm,v 1.73 2008/07/28 23:19:27 jaw Exp $
+# $Id: UDP.pm,v 1.74 2009/02/22 22:42:42 jaw Exp $
package UDP;
@@ -43,6 +43,18 @@
descr => 'text to send once connected',
attrs => ['config'],
},
+ udp::verify_response_ip => {
+ descr => 'verify that responses come from the correct IP address',
+ attrs => ['config', 'inherit'],
+ versn => 3.7,
+ default => 'yes',
+ },
+ udp::verify_response_port => {
+ descr => 'verify that responses come from the correct port',
+ attrs => ['config', 'inherit'],
+ versn => 3.7,
+ default => 'yes',
+ },
udp::rbuffer => {
descr => 'read buffer',
},
@@ -51,7 +63,7 @@
},
udp::connectp => {},
udp::build => {},
-
+
},
};
@@ -308,15 +320,18 @@
my $ip = $me->{ip}{addr};
my $pt = $me->{udp}{port},
- my $ok;
+ my $ok = 1;
eval {
my($rport, $rip) = (length($ip) == 4) ? sockaddr_in( $sa ) : unpack_sockaddr_in6( $sa );
- my $ripa = ::xxx_inet_ntoa($rip);
- $ok = 1 if $rip eq $ip && $rport == $pt;
+ my $ripa = ::xxx_inet_ntoa($rip);
+
+ $ok = 0 if $me->{udp}{verify_response_ip} && ($rip ne $ip);
+ $ok = 0 if $me->{udp}{verify_response_port} && ($rport != $pt);
+
$me->debug("unexpected response from $ripa:$rport") unless $ok;
};
$me->debug("udp recv check failed: $@") if $@;
-
+
return $ok ? undef : 1;
}