Hello Guest

Author Topic: TCP receive  (Read 573 times)

0 Members and 1 Guest are viewing this topic.

Offline cdstg

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
TCP receive
« on: October 14, 2016, 11:45:18 PM »
Is it possible to use a reflex in the ftp receive?
The reason is many of the http servers we are monitoring are not returning a 200 some are sending 30x so I would like to check for 200 or 300


Thanks

Offline enrique_m

  • Administrator
  • Sr. Member
  • *****
  • Posts: 137
  • Karma: 3
    • View Profile
Re: TCP receive
« Reply #1 on: October 20, 2016, 06:34:00 AM »
Hello cdstg,

You can't use regular expresions in TCP receive as it's supposed to be the "conversation" between the server and the target port. A solution could be develop your own server plugin to have the behaviour desired.

Kind regards,
Enrique.

Offline cdstg

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: TCP receive
« Reply #2 on: October 20, 2016, 07:44:39 PM »
Ok I fixed it you can do this

make the module
Remote TCP network agent, alphanumeric data (remote_tcp_string)

set the TCP send
HEAD / HTTP/1.0^M^M
yes head else you will get the whole page and as this data saves it will creat a lot of data so head is the answer


no TCP Receive

Then in the Warning status
HTTP\/\d\.\d\s*40\d

Critical
HTTP\/\d\.\d\s*50\d

So 40X will issue warn
50x will issue Cirtical


You will also need to do a port check else this will go to unknown if the web server is down


 



Offline enrique_m

  • Administrator
  • Sr. Member
  • *****
  • Posts: 137
  • Karma: 3
    • View Profile
Re: TCP receive
« Reply #3 on: October 21, 2016, 12:14:24 AM »
Good trick cdstg!

Thanks for post your solution, it may help other users.

Kind regards,
Enrique.

Offline cdstg

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
    • View Profile
Re: TCP receive
« Reply #4 on: October 23, 2016, 11:19:59 PM »
Actually I looked at the network server Perl code and you can do a regex on the TCP receive for a Boolean module
so you can simply make the http check as

Network type proc

TCP send
HEAD / HTTP/1.0^M^M 
But good to change the standard one in  Pandora to HEAD rather than GET as you do not need to get he whole page anyway

and on TCP Receive
HTTP\/\d\.\d\s*[234]0\d

This means you will get a Cirtical for 500 and no conenction
20X 30X 40X will all report ok











Offline enrique_m

  • Administrator
  • Sr. Member
  • *****
  • Posts: 137
  • Karma: 3
    • View Profile
Re: TCP receive
« Reply #5 on: October 23, 2016, 11:25:35 PM »
Hello cdstg,

Apologies for my confusion. I'm glad you were able to solve it.

Kind regards,
Enrique.