VMware Cloud Community
ima_be
Contributor
Contributor

problem proxy i change "wrapper.conf" but anything change ??

Hello
I have a problem with the proxy, the agent in my machine try to do check http
but i have i proxy in my network , so i have error 407 authentification required ...

i read we can give parametersof JVM , and i do that in the file
agent-4.3.0\bundles\agent-4.3.0-1443\conf\wrapper.conf
i add this in the file after
wrapper.java.additional.7=-Dsun.net.inetaddr.ttl=60


wrapper.java.additional.8=-Dhttp.proxyHost=myproxy
wrapper.java.additional.9=-Dhttp.proxyPort=8080
wrapper.java.additional.10=-Dhttp.proxyUsername=...
wrapper.java.additional.11=-Dhttp.proxyPassword=..



but i have always the same problem, i think hyperic dont manage the proxy

please help me , there are 1 week in this i cant do anything...
0 Kudos
10 Replies
excowboy
Virtuoso
Virtuoso

Hi,

I am not quite sure what you are trying to achieve

If you want to use your HQ Agents to use a Proxy, please see the following document:
http://support.hyperic.com/display/DOC/Agent+Properties#AgentProperties-agent.proxyHost

If you want to setup HTTP checks, that use a proxy please check the following link:
http://support.hyperic.com/display/DOC/http+config

Cheers,
Mirko
0 Kudos
ima_be
Contributor
Contributor

Thank you for the reply,
the company in which I work uses a proxy for all the connection types, and to control this connection each user has a login and password, I might add the proxy address and port, but I can not give the login and password, make a pure result of any check http site that is hosted outside, " google" for example. I have all the time a 407 error , however when i use my browser the website respond so i must have an code 200 and not 407.....

I had already seen what you sent me and I can share added null
proxyUsername and ProxyPassword

so i think i can give JVM some parameters but itsn't working
have you any idea how to resolve this problem?
0 Kudos
excowboy
Virtuoso
Virtuoso

So basically you have to configure your HTTP check(s) to use an proxy with authentication
Again, please read the following doc page
http://support.hyperic.com/display/DOC/http+config
The important setting for you is proxy. Put into the field a URL similar to this one and replace it with the correct values for your environment

http://user:pass@yourproxy:8080

Cheers,
Mirko
0 Kudos
ima_be
Contributor
Contributor

re,
i do that
proxy : http://myname:mypass@myproxy:8080
follow : ok
method: GET
hostname: www.google.fr



and i have this response in yellow
The configuration has not been set for this resource due to : Invalid configuration: Error reported by Agent @ 127.0.0.1:2144: java.lang.NumberFormatException: For input string: "//myname:mypass@myproxy:8080"

please what do you think about ? there are 2 weeks that i cant do anything to resolve this

Imane

Message was edited by: ima_be
0 Kudos
admin
Immortal
Immortal

Hi,

Authentication to a proxy server isn't currently supported by the current version of the netservices plugin.

The only work around I can think of is to use a script service and wrap a script around a call to a command line tool such as curl or wget to do the checking for you.
0 Kudos
ima_be
Contributor
Contributor

thank you for the reply ,Are you sure ?
how about the wrapper.conf ? and can you give me some explications or some documentation for doing this change?
0 Kudos
admin
Immortal
Immortal

Hi,

Yes I'm sure. I looked at the source code of the plugin to see if it used it and it doesn't.

Which change are you wanting to make to wrapper.conf? There is no change needed to wrapper.conf to add a script service to a platform.
0 Kudos
excowboy
Virtuoso
Virtuoso

Hi Wes,

thanks for correcting me. I got a bit confused and I thought you can actually authentication.

Cheers,
Mirko
0 Kudos
ima_be
Contributor
Contributor

firstly ,Thank you for all,
i think add this in the file wrapper.conf of the agent but nothing changes
wrapper.java.additional.8=-Dhttp.proxyHost=myproxy
wrapper.java.additional.9=-Dhttp.proxyPort=8080
wrapper.java.additional.10=-Dhttp.proxyUsername=...
wrapper.java.additional.11=-Dhttp.proxyPassword=..

so,speaking about the code source,how i can see the code source that means the class for the http connction ?, i must change it or just add new plugin in java ?
like this code

String url = "http://www.marchal.com/",
proxy = "proxy.mydomain.com",
port = "8080",
authentication = "usr:pwd";
URL server = new URL(url);
Socket socket = new Socket(proxy,port);
Writer writer = new OutputStreamWriter(socket.getOutputStream(),
"US-ASCII");
writer.write("GET " + server.toExternalForm() + " HTTP/1.0\r\n");
writer.write("Host: " + server.getHost() + "\r\n");
writer.write("Proxy-Authorization: Basic "
+ new sun.misc.BASE64Encoder().encode(
authentication.getBytes())
+ "\r\n\r\n");
writer.flush();
BufferedReader reader = new BufferedReader(new InputStreamReader(
socket.getInputStream(),"US-ASCII"));
String line = reader.readLine();
if(line != null && line.startsWith("HTTP/"))
{
int sp = line.indexOf(' ');
String status = line.substring(sp + 1,sp + 4);
if(status.equals("200"))
{
while(line.length() != 0)
line = reader.readLine();
readResponse(reader);
}
else
throw new FileNotFoundException("Host reports error " +
status);
}
else
throw new IOException("Bad protocol");
reader.close();
writer.close();
socket.close();


i'm sorry for spending your time, but the community isn't big 🙂
0 Kudos
ima_be
Contributor
Contributor

the solution was a script service implemented
with "curl" command
0 Kudos