Discussion:
How to check that services are running correctly?
Rene Behring
2014-07-23 06:59:51 UTC
Permalink
Hello,

i just tried to log in the gsa web interface and it told me that the OMP-Service is down. So i tried "/etc/init.d/openvas-manager status“ and got "openvas-manager (pid 12345) is running“. But it was not running correctly.

Is there a better or other way to test that the all services are running correctly? I want to write a script to test it every hour or something like that...

Thanks,
Rene
Fabrizio Di Carlo
2014-07-23 07:05:35 UTC
Permalink
Hi Rene, all;

I wrote a very little/basic script for launch the services and check
if everything is ok, I think you or someone else can improve it:

--------------------- code --------------

#!/bin/bash
# OpenVAS start file

echo "Launching OpenVAS..."

for i in openvassd openvasmd gsad; do #loop for command to run
echo "Starting $i"
$i
ps cax | grep $i &> /dev/null #check if the program is running
if [ $? -eq 0 ]; then
echo "$i is running" # program is running :)
else
echo "$i is not running" # Opsss... Something wrong
$i
fi
done

echo "OpenVAS launch completed."

--------------------- code --------------

I hope it can help.

Fabrizio
Post by Rene Behring
Hello,
i just tried to log in the gsa web interface and it told me that the OMP-Service is down. So i tried "/etc/init.d/openvas-manager status“ and got "openvas-manager (pid 12345) is running“. But it was not running correctly.
Is there a better or other way to test that the all services are running correctly? I want to write a script to test it every hour or something like that...
Thanks,
Rene
_______________________________________________
Openvas-discuss mailing list
https://lists.wald.intevation.org/cgi-bin/mailman/listinfo/openvas-discuss
--
"The intuitive mind is a sacred gift and the rational mind is a
faithful servant. We have created a society that honors the servant
and has forgotten the gift." (A. Einstein)

"La mente intuitiva è un dono sacro e la mente razionale è un fedele
servo. Noi abbiamo creato una società che onora il servo e ha
dimenticato il dono." (A. Einstein)

Fabrizio Di Carlo
Rene Behring
2014-07-23 07:10:56 UTC
Permalink
Hi Fabrizio,

thanks for the fast response! i have something similar to your script, but i am starting it with the init.d scripts, so all the options are started with it.

Rene
Post by Fabrizio Di Carlo
Hi Rene, all;
I wrote a very little/basic script for launch the services and check
--------------------- code --------------
#!/bin/bash
# OpenVAS start file
echo "Launching OpenVAS..."
for i in openvassd openvasmd gsad; do #loop for command to run
echo "Starting $i"
$i
ps cax | grep $i &> /dev/null #check if the program is running
if [ $? -eq 0 ]; then
echo "$i is running" # program is running :)
else
echo "$i is not running" # Opsss... Something wrong
$i
fi
done
echo "OpenVAS launch completed."
--------------------- code --------------
I hope it can help.
Fabrizio
Post by Rene Behring
Hello,
i just tried to log in the gsa web interface and it told me that the OMP-Service is down. So i tried "/etc/init.d/openvas-manager status“ and got "openvas-manager (pid 12345) is running“. But it was not running correctly.
Is there a better or other way to test that the all services are running correctly? I want to write a script to test it every hour or something like that...
Thanks,
Rene
_______________________________________________
Openvas-discuss mailing list
https://lists.wald.intevation.org/cgi-bin/mailman/listinfo/openvas-discuss
--
"The intuitive mind is a sacred gift and the rational mind is a
faithful servant. We have created a society that honors the servant
and has forgotten the gift." (A. Einstein)
"La mente intuitiva è un dono sacro e la mente razionale è un fedele
servo. Noi abbiamo creato una società che onora il servo e ha
dimenticato il dono." (A. Einstein)
Fabrizio Di Carlo
Fabrizio Di Carlo
2014-07-23 07:21:19 UTC
Permalink
Hi Rene,

Well you can modfy my script just to check if the service is
up&running... Maybe you can execute it after 10/15 seconds and just
use:

for i in openvassd openvasmd gsad; do #loop for command to run
ps cax | grep $i &> /dev/null #check if the program is running
if [ $? -eq 0 ]; then
echo "$i is running" # program is running :)
else
echo "$i is not running" # Opsss... Something wrong
$i
fi
done

my 2 cents,

Fabrizio
Post by Rene Behring
Hi Fabrizio,
thanks for the fast response! i have something similar to your script, but i am starting it with the init.d scripts, so all the options are started with it.
Rene
Post by Fabrizio Di Carlo
Hi Rene, all;
I wrote a very little/basic script for launch the services and check
--------------------- code --------------
#!/bin/bash
# OpenVAS start file
echo "Launching OpenVAS..."
for i in openvassd openvasmd gsad; do #loop for command to run
echo "Starting $i"
$i
ps cax | grep $i &> /dev/null #check if the program is running
if [ $? -eq 0 ]; then
echo "$i is running" # program is running :)
else
echo "$i is not running" # Opsss... Something wrong
$i
fi
done
echo "OpenVAS launch completed."
--------------------- code --------------
I hope it can help.
Fabrizio
Post by Rene Behring
Hello,
i just tried to log in the gsa web interface and it told me that the OMP-Service is down. So i tried "/etc/init.d/openvas-manager status“ and got "openvas-manager (pid 12345) is running“. But it was not running correctly.
Is there a better or other way to test that the all services are running correctly? I want to write a script to test it every hour or something like that...
Thanks,
Rene
_______________________________________________
Openvas-discuss mailing list
https://lists.wald.intevation.org/cgi-bin/mailman/listinfo/openvas-discuss
--
"The intuitive mind is a sacred gift and the rational mind is a
faithful servant. We have created a society that honors the servant
and has forgotten the gift." (A. Einstein)
"La mente intuitiva è un dono sacro e la mente razionale è un fedele
servo. Noi abbiamo creato una società che onora il servo e ha
dimenticato il dono." (A. Einstein)
Fabrizio Di Carlo
_______________________________________________
Openvas-discuss mailing list
https://lists.wald.intevation.org/cgi-bin/mailman/listinfo/openvas-discuss
--
"The intuitive mind is a sacred gift and the rational mind is a
faithful servant. We have created a society that honors the servant
and has forgotten the gift." (A. Einstein)

"La mente intuitiva è un dono sacro e la mente razionale è un fedele
servo. Noi abbiamo creato una società che onora il servo e ha
dimenticato il dono." (A. Einstein)

Fabrizio Di Carlo
Rene Behring
2014-07-23 07:28:21 UTC
Permalink
I forgot that i can use the openvas-check-setup, that script is doing a lot of checks. ;)
i will take that and grep for some errors and warnings…

But thanks for your help!

Rene
Post by Fabrizio Di Carlo
Hi Rene,
Well you can modfy my script just to check if the service is
up&running... Maybe you can execute it after 10/15 seconds and just
for i in openvassd openvasmd gsad; do #loop for command to run
ps cax | grep $i &> /dev/null #check if the program is running
if [ $? -eq 0 ]; then
echo "$i is running" # program is running :)
else
echo "$i is not running" # Opsss... Something wrong
$i
fi
done
my 2 cents,
Fabrizio
Post by Rene Behring
Hi Fabrizio,
thanks for the fast response! i have something similar to your script, but i am starting it with the init.d scripts, so all the options are started with it.
Rene
Post by Fabrizio Di Carlo
Hi Rene, all;
I wrote a very little/basic script for launch the services and check
--------------------- code --------------
#!/bin/bash
# OpenVAS start file
echo "Launching OpenVAS..."
for i in openvassd openvasmd gsad; do #loop for command to run
echo "Starting $i"
$i
ps cax | grep $i &> /dev/null #check if the program is running
if [ $? -eq 0 ]; then
echo "$i is running" # program is running :)
else
echo "$i is not running" # Opsss... Something wrong
$i
fi
done
echo "OpenVAS launch completed."
--------------------- code --------------
I hope it can help.
Fabrizio
Post by Rene Behring
Hello,
i just tried to log in the gsa web interface and it told me that the OMP-Service is down. So i tried "/etc/init.d/openvas-manager status“ and got "openvas-manager (pid 12345) is running“. But it was not running correctly.
Is there a better or other way to test that the all services are running correctly? I want to write a script to test it every hour or something like that...
Thanks,
Rene
_______________________________________________
Openvas-discuss mailing list
https://lists.wald.intevation.org/cgi-bin/mailman/listinfo/openvas-discuss
--
"The intuitive mind is a sacred gift and the rational mind is a
faithful servant. We have created a society that honors the servant
and has forgotten the gift." (A. Einstein)
"La mente intuitiva è un dono sacro e la mente razionale è un fedele
servo. Noi abbiamo creato una società che onora il servo e ha
dimenticato il dono." (A. Einstein)
Fabrizio Di Carlo
_______________________________________________
Openvas-discuss mailing list
https://lists.wald.intevation.org/cgi-bin/mailman/listinfo/openvas-discuss
--
"The intuitive mind is a sacred gift and the rational mind is a
faithful servant. We have created a society that honors the servant
and has forgotten the gift." (A. Einstein)
"La mente intuitiva è un dono sacro e la mente razionale è un fedele
servo. Noi abbiamo creato una società che onora il servo e ha
dimenticato il dono." (A. Einstein)
Fabrizio Di Carlo
Loading...