Get TRAP Sender´s IP

2004-11-29 Thread diogo . senai
Hi List, I´m new around and I´m having kind´a difficulty to solve this
problem.
Well, I´m writing 2 scripts that will be kept in a server. The first one
receives SNMP traps on port 162 (duh!) every 10 seconds and it writes
something to a file, just for a record.
The second script checks, every 30 seconds, if the file has changed since
the last check. If it has, that means that the SNMP Trap Sender is UP, if
the file ('test.txt') hasn´t changed, the trap sender´s server is down,
and then the trap receiver server creates an HTML informing if it´s up or
down.
So far so good, as you´ll see (´cause I´ll put the scripts here), it´s
working, but my problem starts here. In my network, I´ll have a lot of net
actives sending traps (servers, workstations, ADSL modems), so, to figure
out which one is sending each trap, i have to detect the trap sender´s IP.
And here is my question: How do I do so?
I mean, I´m using SNMP_Session module. How do I detect the trap sender´s
IP? Does this information comes with the trap or should I do something to
detect who has sent information to port 162?
Thanks!


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Automatically fill in a web-form field

2004-12-03 Thread diogo . senai
Hi folks,

I´d like to ask for your help. I´d like to create a script that consults
automatically a code in a page. Something like this: I´ll have in a
database some codes. I want to make a script that everyday at 6:00 pm
sends each code to a page´s form field to consult information about that
code.
I mean, this page is used to make consults about codes. We visit it,
fillin the form field, click submit and we get a result. I need to develop
a script that does it all by itself.
So, I beleive I need a script that makes a 'put' method and get the
result, is it right?
Thanks for you all,

Diogo Nunes de Oliveira.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




LWP::UserAgent::FramesReady

2004-12-07 Thread diogo . senai
Hi you all,

I'm trying to write a script that sends a code to a website, filling in a
form-field, and get the result. Just using LWP module isn't possible,
because this module doesn't support frames. So I found at cpan.org that
LWP::UserAgent::FramesReady may help me, but I don't understand how to use
it. Can anyone help me?
This LWP::UserAgent::FramesReady module is enough for me?


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




LWP::UserAgent -> Not in this case?

2004-12-09 Thread diogo . senai
Hi folks,

I´m here again to once more ask for your help. As some of you know, I´m
trying to create a script that automatically fills in a formfield and get
the result of that search.
It´s based on a code, for example: 9600352534
The link to the form is
'http://www.tj.go.gov.br/online/Inicial/Processos/ConsultaProc_1Grau_Capital.dml
and we need to fill in only the first field, called ‘numrproc’, with the
code.
Then, the result will be given by the link bellow:
http://www.tj.go.gov.br/online/Capital/Processos_SPG/Resp_Processo1.dml

I´ve tried my script searching for a module at search.cpan.org and it
works fine, but at the page that I need, it doesn´t.
This page is brazilian, but you´ll see that if you wish to help me, there
will be no problem.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: LWP::UserAgent -> Not in this case?

2004-12-09 Thread diogo . senai
Hi,

thanks jonathan, but it´s still not working...
In this formfield (numrproc) there´s a script to check if only numbers are
being typed etc... Can this script be the problem of all?

I´m posting here the source of my script and I´d really really really
apreciate if you could try this out with me...
Thanks!
#!/usr/bin/perl

  use LWP::UserAgent;
  $ua = LWP::UserAgent->new;
  $ua->agent("MyApp/0.1 ");
  $ua->cookie_jar({});

my $req = HTTP::Request->new(POST =>
'http://www.tj.go.gov.br/online/Capital/Processos_SPG/Resp_Processo1.dml');
#my $req = HTTP::Request->new(POST =>
'http://www.tj.go.gov.br/online/Inicial/Processos/ConsultaProc_1Grau_Capital.dml');
$req->content_type('application/x-www-form-urlencoded');
$req->content('numrproc=009600352534');
#&mode=dist');

  my $res = $ua->request($req);

  if ($res->is_success) {
  print $res->content;
  }
  else {
  print $res->status_line, "\n";


> Hi,
>
> I can only guess at the source of the problem.  I think it is because that
> web
> site requires cookies.  The solution is to have a cookie jar, like:
>
> my $agent = LWP::UserAgent->new();
> $agent->cookie_jar({});
>
> Jonathan Paton
>
> --
> #!perl
> $J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13
> 17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4
> 00+4 00+8 1-21 01+1 00+5 01-7 >=~/ \S\S \S\S /gx) {m/(
> \d+) (.+) /x,, vec$ J,$p +=$2 ,8,= $c+= +$1} warn $J,,
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
>
>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




If you´re in the mood, help me.

2004-12-10 Thread diogo . senai
Hi guys,

As you know, i´m having some problems to make this thing work. I have to
write a script that automatically sends a code and get the some
information according to that code. I mean, this script has to
automatically fill in a formfield and get the result. But I just can´t get
it done. If you´re really really in the mood for helping me, I´m posting
down here the source code of the page of the form that the script must
fill in and get the result. The url is:
http://www.tj.go.gov.br/online/Inicial/Processos/ConsultaProc_1Grau_Capital.dml
And here is the URL for the page that returns the result:
http://www.tj.go.gov.br/online/Capital/Processos_SPG/Resp_Processo1.dml
After this source code, you´ll see the code of my script, please, help me!






Consulta Processos da Capital

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i







  


  
  Processos de 1º Grau - Processos da
Capital
  


  

  


    Processo:
  


  
  

  


  

  

    Oab
Advogado:
  

  AC
  AL
  AM
  AP
  BA
  CE
  DF
  ES
  GO
  MA
  MG
  MS
  MT
  PA
  PB
  PE
  PI
  PR
  RJ
  RN
  RO
  RR
  RS
  SC
  SE
  SP
  TO
 

  
  

  


  

  

    Nome
Parte:
  



    
   --Não
utilize acentos no Nome da Parte--
  
  
  

  


  
  A Consulta de
  Processos está disponível de
  SEG-SEX das 8:00 às 22:00 h  
  Copyright 2004. Todos os direitos reservados.
  
  
 http://webmail.tj.go.gov.br/cgi-bin/Count.cgi?trgb=ff&dd=E";
ALT="Nº de acessos!">
  


   document.form1.numrproc.focus();






PERL Script
#!/usr/bin/perl
  use LWP::UserAgent;
  $ua = LWP::UserAgent->new;
  $ua->agent("MyApp/0.1 ");
  $ua->cookie_jar({});

my $req = HTTP::Request->new(POST =>
'http://www.tj.go.gov.br/online/Capital/Processos_SPG/Resp_Processo1.dml');
#my $req = HTTP::Request->new(POST =>
'http://www.tj.go.gov.br/online/Inicial/Processos/Cons

Automatically fill in a web-form field-get response

2004-12-15 Thread diogo . senai
Hi you all,

I´d like to thank everyone that helped me with that little problem about
filling in a webformfield and getting the result. I´d like to inform you,
in case it comes to you... LWP::UserAgent really didn´t help me out, but
www::mechanize solved all my problems, the script is up and running good!
Thank you all!

Diogo N Oliveira (brazilian)


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Variable Value into MySQL DB

2004-12-27 Thread diogo . senai
Hi guys,

I´m having kind´a problem... Here´s the deal... I´m using CGI so that the
user can, by a browser, type the data that must be recorded into the
database.
I use CGI library to do that... the user type what he wants in the fields,
and these values are sent to some variables... Then, I´d like to record
these variables values in the db... But I just can´t get it done!
I´m using Net::MySQL to do so... when I test the script by writing fixed
values in it, it works fine... but when i try to record variables values
it doesn´t work... could you help me? Here´s my code:
#!/usr/bin/perl
use strict;
use CGI qw/:standard/;
 use Net::MySQL;
print header,
start_html('Cadastro de Processos'),
h1('Cadastramento Processos'),
start_form,
"Numero do Processo: ",textfield('process'),br,
"Tipo do Processo: [1-2]",textfield('type'),br,
"Nome do advogado: ",textfield('name'),br,
"Email do advogado: ",textfield('email'),br,
submit,
end_form,
hr,
my $process =param(process);
my $lawyer =param(name);
my $email =param(email);
my $type =param(type);

  my $mysql = Net::MySQL->new(
  database => 'tj',
  user => 'user',
  password => 'pass'
  );

   $mysql->query(q{
   INSERT INTO processo (process, name, email, type) VALUES ($process,
$lawyer, $email, $type)
   });



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




CGI and variables? What´s the problem?

2004-12-29 Thread diogo . senai
Hi guys... I´d like to ask you a question. Some of you might have
encountered something like this... I´m creating a web interface using CGI
library so that the user enter a data in the textfield, i put these values
into some variables and use them in the system... for example... I type
the new date and the script executes the date command with that value
typed in the textfield... but I just can´t get it done... If I give fixed
value to the variable, it works fine... but in the same script of the CGI,
it doesn´t...
Please, help me!

Thanks!


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Execute commands on the servers through a cgi script

2005-01-08 Thread diogo . senai
Hi guys...
I've being trying to do so... but I just can't get it done... I'm trying
to execute a command through a CGI... For example... the user types in a
textfield: /bin/date -s 20050427, then submmit. This command is sent to
the server, and the date is changed... I can't get it done... any idea?

Diogo N Oliveira.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]