need commands/script to find some specific outputs

Hi All ,

Need you help to find output in below format on redhat :

--> ServerName,Server Model,OS,HP SIM version,Port status 2301,port status 2381 @ ILO IP interface

if the ports are listening than i would need to specify the interface of the same.
Who is Participating?
skullnobrainsConnect With a Mentor Commented:
echo ,

#Server Model
dmidecode | sed -n '/System Information/,/Product/ s/Product Name:\(.*\)/\1/p'
echo ,

echo RedHat,

#HP SIM version
# no idea but SIM should ome with a command-line tool with a -v -V or --version option of some sort

#Port status 2301
if lsof -ni :2301 -s TCP:LISTEN >/dev/null
then echo LISTENING
else echo CLOSED
# beware this does not check the firewall
echo ,

#port status 2381
# same as previous

#@ ILO IP interface
no idea what you expect there

} | tr -d "\n"
It looks as though there aren't any HP SIM users here...

If you gave us the commands which produced the equivalent data on HPUX machines., we might be able to help with the RedHat conversion.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.