38 |
|
public String runServiceCheck(String hostname){ |
39 |
|
String message, status; |
40 |
|
try { |
41 |
< |
// try to read a response |
42 |
< |
String response = connectToService(hostname, 23); |
41 |
> |
// connect |
42 |
> |
Socket socket = new Socket(hostname, 23); |
43 |
> |
BufferedReader socketIn = new BufferedReader(new InputStreamReader(socket.getInputStream())); |
44 |
> |
// close |
45 |
> |
socketIn.close(); |
46 |
> |
socket.close(); |
47 |
> |
|
48 |
|
// we only get past here if we connected... |
49 |
|
// ...which is all we care about |
50 |
|
status = "0"; |
54 |
|
message = "Service check failed to establish connection to host: " + e.getMessage(); |
55 |
|
} |
56 |
|
return "<Telnet status=\"" + status + "\" message=\"" + message + "\"></Telnet>"; |
57 |
+ |
} |
58 |
+ |
|
59 |
+ |
/** |
60 |
+ |
* return the String representation of what the filter does |
61 |
+ |
*/ |
62 |
+ |
public String getDescription(){ |
63 |
+ |
return DESC; |
64 |
|
} |
65 |
|
|
66 |
|
//---PRIVATE METHODS--- |