Re: checking port status with perl

2003-06-04 Thread Andy Ford
According to the "mon" readme it is basically a scheduler/reporting
tool. i.e 'None of the actual service testing or reporting is
actually handled by "mon". These functions are handled by auxillary
programs.'

I was after an approach that I could use to test services i.e. the
modules to be used within mon. e.g. I can see that httpd is running but
how do I know it is accepting connections

see what I mean ;0)

Thanks

On Tue, 2003-06-03 at 14:36, Shevek wrote:
> On Tue, 3 Jun 2003, Andy Ford wrote:
> 
> > Hi all
> > 
> > I am writing a Perl script to check the status of a number of processes
> > on a solaris machine i.e. to check mysqld I can use 
> > 
> > my $result = $dbh->ping;
> > 
> > Is there a perl module that will allow me to do something similar with
> > apache or sshd to see if they are running and accepting connections?
> 
> Yes. Mon.
> 
> S.
-- 
Andy Ford <[EMAIL PROTECTED]>
Telindus




Re: checking port status with perl

2003-06-04 Thread Shevek
On Tue, 3 Jun 2003, Andy Ford wrote:

> According to the "mon" readme it is basically a scheduler/reporting
> tool. i.e 'None of the actual service testing or reporting is
> actually handled by "mon". These functions are handled by auxillary
> programs.'

Many such auxiliary programs are included with Mon. I suggest you take a 
closer look at it.

S.

> I was after an approach that I could use to test services i.e. the
> modules to be used within mon. e.g. I can see that httpd is running but
> how do I know it is accepting connections
> 
> see what I mean ;0)
> 
> Thanks
> 
> On Tue, 2003-06-03 at 14:36, Shevek wrote:
> > On Tue, 3 Jun 2003, Andy Ford wrote:
> > 
> > > Hi all
> > > 
> > > I am writing a Perl script to check the status of a number of processes
> > > on a solaris machine i.e. to check mysqld I can use 
> > > 
> > >   my $result = $dbh->ping;
> > > 
> > > Is there a perl module that will allow me to do something similar with
> > > apache or sshd to see if they are running and accepting connections?
> > 
> > Yes. Mon.
> > 
> > S.
> 

-- 
Shevekhttp://www.anarres.org/
I am the Borg. http://design.anarres.org/



Re: URL wierdness...

2003-06-04 Thread Jonathan Stowe
On Mon, 2 Jun 2003, Jody Belka wrote:

> IMAP HILLWAY\ said:
> >
> > Now... this works fine for almost every URL I can think of apart from 2:
> > http://www.acxiom.co.uk & http://www.acxiom.com
> > These 2 both return "500 Internal Server Error" but work fine if you go
> > to them with a browser!
>
> bit of checking and it seems that they're using the Accept-Language
> header, and don't imagine you might not send it. if you add that to the
> request (a simple en or en-us will do the trick) then things work
> properly. really bad form on their side of course.
>

As I suspected - if you were on the local machine you would have seen a
stack trace like:

[NullReferenceException]: Object reference not set to an instance of an
object.
   at LangTest.WebForm1.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\langtest\webform1.aspx.cs:line 24
   at System.Web.UI.Control.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain()
[HttpUnhandledException]: Exception of type
System.Web.HttpUnhandledException was thrown.
   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain()
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)


They will be using the array returned by System.Web.Request.UserLanguages
without checking it.

This of course would be simply fixed with some code like:

   string bestlanguage = "en-gb";
   string[] userLang = Request.UserLanguages;

  if ( userLang != null )
  {
 bestlanguage = userLang[0];
  }

  

If someone from the company concerned is reading my consulting rates are
reasonable ;-)

/J\







Re: checking port status with perl

2003-06-04 Thread Christof Damian
On Tue, 03 Jun 2003, Andy Ford wrote:
> I was after an approach that I could use to test services i.e. the
> modules to be used within mon. e.g. I can see that httpd is running
> but how do I know it is accepting connections

For http LWP springs to mind. For SSH a check on the tcp port with
Socket is probably enough, though there might be a Perl ssh library
out somewhere. 

Or you use the shell commands which come with one of the monitoring
programs, they usually have a standard set of options and are well
tested. I use nagios (used to be called netsaint), which is lovely. 

christof
-- 
Christof Damian 
guideguide ltd. 



Re: checking port status with perl

2003-06-04 Thread Andy Ford
Thanks for your suggestions

;0)

On Tue, 2003-06-03 at 15:28, Christof Damian wrote:
> On Tue, 03 Jun 2003, Andy Ford wrote:
> > I was after an approach that I could use to test services i.e. the
> > modules to be used within mon. e.g. I can see that httpd is running
> > but how do I know it is accepting connections
> 
> For http LWP springs to mind. For SSH a check on the tcp port with
> Socket is probably enough, though there might be a Perl ssh library
> out somewhere. 
> 
> Or you use the shell commands which come with one of the monitoring
> programs, they usually have a standard set of options and are well
> tested. I use nagios (used to be called netsaint), which is lovely. 
> 
> christof
-- 
Andy Ford <[EMAIL PROTECTED]>
Telindus




Thai pub lunch, Friday 1pm

2003-06-04 Thread Kate L Pugh
Thai food is great for hangovers - and surely people will have
hangovers after the social meet at the Star on Thursday.  How about a
nice pub lunch at Churchills in Holborn on Friday.
  http://grault.net/cgi-bin/grubstreet.pl?Churchills,_WC1X_0AE

If nobody else comes I am going on my own, since it's all of 1
minute's walk from my office.  1pm sounds like a reasonable time.

Kake




Re: [Ab]use of penderel

2003-06-04 Thread Nicholas Clark
On Mon, Jun 02, 2003 at 11:44:56PM +0100, Paul Makepeace wrote:

> I personally don't see operating a piece of software under Debian stable
> as a significant risk, especially one that is not listening on a port,
> on a machine whose data everyone *ahem* has back-ups of :-)

I agree.

Although google quickly found me a moderately recent mailman cross
site scripting bug:

http://cert.uni-stuttgart.de/archive/bugtraq/2003/01/msg00247.html

I presume that that those sort of bugs rapidly get fixed by updated
packages on security.debian.org

Nicholas Clark



RE: Reaping processes

2003-06-04 Thread David M. Wilson
Setting SIGCHLD to SIG_IGN would mean you would never have to call waitpid,
or install your own signal handler. Processes don't hang around as defunct,
they die straight away. I'd assume there is a way of calling signal(SIGCHLD,
SIG_IGN) in perl.

David.

PS. Yes, I'm top-posting and using Outlook. Sue me. This laptop sucks.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Nigel Hamilton
Sent: 01 June 2003 14:13
To: [EMAIL PROTECTED]
Subject: Reaping processes


Hi,

Ive got a mini-webserver that forks processes and then
supposedly kills them when complete.

The process killing happens here:

use POSIX 'WNOHANG';# see Stein's idiom p. 305 Network Programming with
Perl

# kill all zombie's including hanging zombies, needed for cleaning up rogue
processes
$SIG{CHLD} = sub { while (waitpid(-1,WNOHANG) > 0 ) { } };

Sometimes though zombie processes are still hanging around -
at the moment there are over 200+ zombies (defunct=does
anyone have a bul




Re: checking port status with perl

2003-06-04 Thread Jonathan Peterson


For http LWP springs to mind. For SSH a check on the tcp port with
Socket is probably enough, though there might be a Perl ssh library
out somewhere. 

There is a pure perl SSH library which I can strongly recommend for 
people who:

1. Want to install 20 required esoteric CPAN modules ;-)
2. Dislike riding on C libraries (although some of the required maths 
modules I think have C cores).
3. Want to be able to put passwords in programs and automate things 
fully (which was my requirement).

Jon





Re: checking port status with perl

2003-06-04 Thread Andy Ford
Go for it - what is your recommendation?


On Wed, 2003-06-04 at 11:32, Jonathan Peterson wrote:
> >
> >
> >For http LWP springs to mind. For SSH a check on the tcp port with
> >Socket is probably enough, though there might be a Perl ssh library
> >out somewhere. 
> >
> There is a pure perl SSH library which I can strongly recommend for 
> people who:
> 
> 1. Want to install 20 required esoteric CPAN modules ;-)
> 2. Dislike riding on C libraries (although some of the required maths 
> modules I think have C cores).
> 3. Want to be able to put passwords in programs and automate things 
> fully (which was my requirement).
> 
> Jon
-- 
Andy Ford <[EMAIL PROTECTED]>
Telindus




Re: international beer summit

2003-06-04 Thread Perrin Harkins
On Wed, 2003-06-04 at 19:47, Kate L Pugh wrote:
> Yes!

Great!  I'll be there from the 22nd through the 28th and have no plans
yet.  I'm going to rent an apartment with some friends in Clerkenwell. 
Nearest underground is Farringdon and Chancery Lane.

I'm looking forward to some cross-cultural Perl goodness.

- Perrin