#!/bin/bash # # ====================================================================== # VI editor settings # set shiftwidth=4 # set tabstop=4 # ====================================================================== # Title: List ILOM/BMC users and permissions on a node # Author: Mike Gore # Date: 7 July 2015 # Depends: package: openipmi, Scripts: common_host,common_vars,common_functions and NODES found in /usr/local/bin # # Example: ./ipmiuserlist host-ilom # - Where host-ilom is the node ILOM/BMC interface # - needs and AMDIN user and password to function # Result: List ILOM/BMC users permissions on a node # # Notes: # The script will prompt for ADMIN user and password unless the following environment variables are set: # ADMIN - userid of ADMIN user # ADMINPASS - Password of "ADMIN" user # ====================================================================== . common_vars . NODES setadmin LOM="$1" if [ -z "$LOM" ] then echo "Expected node ILOM name" exit 1 fi if ping -c 1 -w 1 "$LOM" 2>/dev/null >/dev/null then echo "Node $LOM is up" host $LOM echo User List ipmitool -I lanplus -H $LOM -U $ADMIN -P $ADMINPASS user list 1 echo User access settings ipmitool -I lanplus -H $LOM -U $ADMIN -P $ADMINPASS channel getaccess 1 2 ipmitool -I lanplus -H $LOM -U $ADMIN -P $ADMINPASS channel getaccess 1 3 ipmitool -I lanplus -H $LOM -U $ADMIN -P $ADMINPASS channel getaccess 1 4 else echo "Node $LOM is down" fi