----- Original Message -----
Sent: Thursday, March 03, 2005 4:43
AM
Subject: [Bigsister-general] Simple test
returns: Requester: no handler for domain sock.
Hi,
I was following with interest the series of
articles on developing your own tests (run over Christmas) and am having
problems with a new test I am developing. As it failed to work I went back to
basics and I still can't get it to work. The test is for monitoring socket
processes running on our servers.
I have included the relevant code that may assist
you to assist me.
Does someone please have an idea of what I have done
wrong.
Your help is greatly appreciated.
Regards
Simon Bole-Brown
Toll
Priority
Australia
My etc/testdef/sock.cgf:
-----------------------------------
#
# retrieve the
number of Sockets
# Simon Bole-Brown - 10 Feb 2005
test
sock_users_check {
static set name "sock";
static set features
local unix;
static set description "Monitor the number of sockets running on a
server";
static set arguments
"perf:int:report
perf data every perf minutes"
"max:int:Maximum
number of sockets required."
"min:int:Minimum
number of sockets required."
"item:string:Item as
which to report.";
pernode set report_item "sock";
# Items from
single_value #
set discover_refresh 60*24;
set discover_retry
60;
set
perf_frequency 5;
set host "set by uxmon";
set alias "set by
uxmon";
# End of items from single_value
init {
instance set max
2;
instance set min 2;
instance import perf perf_frequency;
instance import
max;
instance import min;
instance import item
report_item;
}
pernode monitor {
get sock.hrSockCount[0];
pernode set
socket_count ${sock.hrSockCount[0]};
}
pernode report
{
status
red ( ${socket_count} > ${max} ) "&red" " " ${socket_count} " Sockets
> permitted ( " ${max} " )";
status red (
${socket_count} < ${min} ) "&red" " " ${socket_count} " Sockets <
permitted ( " ${min} " )";
status green 1 "&green" " " ${socket_count} " sockets (
Max > " ${max} ", Min > " ${min} " )";
comment "html"
"<hr />"
"Number of sockets: " ${socket_count} " ( Max > " ${max} ", Min >
" ${min} " )";
}
perf {
export always single.sockCount, ${socket_count};
export sometimes
single.sockCount.description, "Sockets";
}
}
My uxmon/Requester/sock.pm:
---------------------------------------------
package
Requester::sock;
use strict;
@Requester::sock::ISA =
qw(Requester::Requester);
my $requester = new Requester::sock;
sub new
{
my ($this, $args ) =
@_;
my
$class = ref($this) || $this;
my $self =
{};
bless($self, $class);
$self->register(
"sock" );
return $self;
}
sub getinfo {
my( $self ) =
@_;
#
Get socket count
chomp ($sock_count = `ps -ef | grep "phantom
SOCKET.SERV.CCS" | grep -vc grep`);
return { 0 => {
"hrSockCount" =>
$sock_count
} };
}
1;
uxmon-net (edited for relevant sections
only)
---------------
DEFAULT community=public frequency=5 ALL
# Set the default
version and protocol for rpc checks to "1" and "udp"
DEFAULT version=1
proto=udp rpc
DESCR features=unix,solaris device=computer localhost
localhost
perf=10 max=2 min=2 sock