AIX check_services or check_subsystem

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

AIX check_services or check_subsystem

Post 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!
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: AIX check_services or check_subsystem

Post 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.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: AIX check_services or check_subsystem

Post 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.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: AIX check_services or check_subsystem

Post by slansing »

Ah the beauty of simple bash. Locking!
Locked