Pages: [1]   Go Down
Author Topic: module_tcpcheck on linux agents?  (Read 449 times)
0 Members and 2 Guests are viewing this topic.
opike
Full Member
***

Karma: 0
Offline Offline

Posts: 26


View Profile
« on: December 20, 2010, 05:38:07 PM »

Windows agents can use module_tcpcheck and I tried using the same module with a linux agent but it doesn't seem to be recognized. Just want to confirm if module_tcpcheck is available with linux agents and if not, what is the equivalent that people generally implement?
Logged

opike
Full Member
***

Karma: 0
Offline Offline

Posts: 26


View Profile
« Reply #1 on: December 27, 2010, 04:47:16 PM »

I ended up developing a perl script that writes a success/fail flag to stdout.
Logged

rsantaella
Newbie
*

Karma: 0
Offline Offline

Posts: 8


View Profile
« Reply #2 on: January 25, 2011, 05:32:15 PM »

Can you share this script?
Logged

opike
Full Member
***

Karma: 0
Offline Offline

Posts: 26


View Profile
« Reply #3 on: January 28, 2011, 06:10:58 PM »

Code:
#!/usr/bin/perl

$command="ping -c 1 ".$ARGV[0]." 1>out 2>error ";

system($command);

open(INFILE, "out") or die "Cannot open out: $!.\n";

$success=0;

while(my $line = <INFILE>)
{

        if ($line =~ m/1 received/)
        {
                $success=1;
        }
}
print $success."\n";

close INFILE;

Logged

Luismi
Global Moderator
Sr. Member
*****

Karma: 6
Offline Offline

Posts: 153



View Profile
« Reply #4 on: January 31, 2011, 12:39:21 PM »

Hi opike,

This module is only available for windows agents, don't works for Linux agents.

Thanks for the script.

Cheers.
Logged

Pages: [1]   Go Up
Print
 
Jump to:  


SourceForge.net Logo  This site is monitored by Pandora FMS   ArticaST