Link to home
Start Free TrialLog in
Avatar of Frog_1337
Frog_1337

asked on

HPUX Scripting

I am writing a script to check if the snmpd service is running on a dev server. I have the script written but every time I run it the results come back that the service is running even if I have manually stopped the service. I am very confused with this. The script is below.

#!/bin/bash

OUTPUT=$(ps -ef | grep snmpd | wc -l)

if [ $OUTPUT -lt 1 ];
then
        echo "SNMPD is not running"
else
        echo "SNMPD is running"
fi
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Frog_1337
Frog_1337

ASKER

That was it thank you so much
You're always welcome, glad I could help!

Please consider accepting my comment as the solution.

Greetings

wmp