Discover Java Framework with version on Linux Server

utente
Giga Expert

Hi All,

I want create a custom probe and sensors, to identify on the linux server the existence of Java Framework and the version of this component.

The identification of Java Framework is based on the discovery of at least one process with name java;

This create a CI on CMDB (Generic Application Form) relate it with the linux server.

After that it triggered a probe that execute the SSH Command:

  • java -version

and the result of the command execution will be analyzed by script on the Sensor

But if I will test the Probe, I have this result:

find_real_file.png

find_real_file.png

The output of the command is empty (I see only the closure tag)

and the very result is in the "warm"

Why it ?

I think that in this case the sensor doesn't   work because it doesn't   have data for work..

1 ACCEPTED SOLUTION

utente
Giga Expert

Hi all,


I have found the solution the execute the command "java -version" and to have an output.


It's sufficient add at the probe, a new probe parameter "must_sudo" with value "true".


Now the result of the command will be present in the output file.



Regards,



Vincenzo




find_real_file.png


View solution in original post

8 REPLIES 8

tim_broberg
ServiceNow Employee
ServiceNow Employee

Vincenzo, the "warn" tag contains stderr output when the return code of the process was 0.



Perhaps if you changed the name to "java -version 2>&1"?


Hi Tim,


I think this command is near the solution of the problem but,


unfortunately if I override the command "java -version" with "java -version 2>&1" in the field "ECC queue name"


The system responds with an empty result.



find_real_file.png


Thanks @tim_broberg , it saved my life.

I had more or less the same requirement : get the java version of the Websphere application.

I managed to do it this way:

midjoule_0-1682520043472.png

Best regards

tim_broberg
ServiceNow Employee
ServiceNow Employee

Awesome! Thanks for the feedback.