Page 1 of 1
AIX check_services or check_subsystem
Posted: Mon Aug 26, 2013 9:42 am
by BanditBBS
In AIX services are referred to as subsystem and you can check them with the 'lssrc -s whatever' command. That will let you know if they are in active state or any other state. Anyone have a check that is written to check services/subsystems on AIX?
I've been googling all morning, but my google skills have been failing me recently.
Thanks!
Re: AIX check_services or check_subsystem
Posted: Mon Aug 26, 2013 10:18 am
by slansing
I'll help do some poking around as well but I was not able to turn anything up yet and don't know of any subsys / service plugins for AIX, just process checks.
Re: AIX check_services or check_subsystem
Posted: Mon Aug 26, 2013 12:03 pm
by BanditBBS
Ok, it's ugly, but attached is my hack of an already existing script to make it work with AIX.
Code: Select all
#!/bin/sh
PROGNAME=`basename $0`
print_usage() {
echo "Usage: $PROGNAME"
}
print_help() {
echo ""
print_usage
echo ""
echo "This plugin checks the status of subsystems services on AIX."
echo ""
support
exit 0
}
case "$1" in
--help)
print_help
exit 0
;;
-h)
print_help
exit 0
;;
*)
if [ $# -eq 1 ]; then
lssrc -a |grep $1|grep active
ret=$?
case "$ret" in
0)
exit 0
;;
1)
lssrc -a |grep $1|grep inoperative
ret2=$?
case "$ret2" in
0)
exit 2
;;
*)
echo "ERROR: No service found with that name!!"
exit 1
;;
esac
esac
else
echo "ERROR: Some unknown error occured!!!"
exit 2
fi
;;
esac
As programmed, it will return OK if active, Critical if Inoperative, warning if some other status or no service found and critical if some error happens with the script.
Please feel free to lock this topic.
Re: AIX check_services or check_subsystem
Posted: Mon Aug 26, 2013 12:36 pm
by slansing
Ah the beauty of simple bash. Locking!