- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- HelpDesk Script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-10-2010 09:56 AM
тАО03-10-2010 09:56 AM
When I log in as HelpDesk enter their password it will bring up the screen I select option 4 and here is the message I receive. ANy ideas what I am missing? Thanks
Username to modify amb0503
/usr/bin/Helpdesk[92]: sudo: not found.
# Script is for the Help Desk to perform tasks for the sysadmin. These are limited and restricted to the Help Desk only.
# Any additional problems or issues, the Help Desk will contact the Sysadms to resolve them.
#
#
###############################################################
#!/usr/bin/sh
#
#
#
set -u
trap '' INT
function cont
{
print -n "Do You Wish to Continue Y/N : "
read answ
if [[ $answ = [Yy] ]]
then
return 0
else
return 1
fi
}
while true
do
clear
print -n "
* HELP DESK MENU *
$(uname -n)
HELLO: $(whoami)
===================================================
*************************
* ATI ALLVAC Help Desk *
*************************
1. Display printer status / print jobs.
a. Enter lpstat -p to view all printers
b. Enter lpstat -o to view all print request
2. Cancel a print job.
3. Cancel ALL print jobs for a printer.
4. Unlockes and Resets User Passwords
NOTE: A number or a group of letters will show on the screen,
write down and provide this information to the user.
5. This will execute the TOP command to look at the high load average on the servers. Monitoring purposes
NOTE: Control C breaks the process and returns to the Main Menu
6. EXIT this program.
===================================================
Select an Option # from above: "
read answer
case "$answer" in
6*|Qq|bye|Ee ) print "Quitting! See You Later, $(whoami)" ; exit ;;
5) if cont
then
/usr/bin/top
fi;;
1) if (( $? == 0 ))
then
print -n "Enter Printer Name: "
read prtr
lpstat $prtr
print -n "OK to clear screen [Hit Any Key]"
read h
fi;;
2) if (( $? == 0 ))
then
print -n "Enter Printer Name-job#: "
read prtr
cancel $prtr
fi;;
4) echo "Username to modify \c"; read USER
TESTUSER=`awk -v USER=${USER} -F: '$1~USER { print $1 }' /etc/passwd`
if test "${USER}" != "${TESTUSER}"
then
echo "${USER} is invalid!"
echo "Press [ENTER] to continue. \c"
read NOTHING
else
#This command looks at the account if it has a password liftime expired it will reset the account and enable it
sudo /usr/lbin/modprpw -x ${USER}
sleep 10
#This command runs the password reset brings up a prompt and 3 choices, selcting 3 is the best for the help desk
#passwd ${USER}
fi;;
3) if (( $? == 0 ))
then
print -n "..Enter printer name :"
read prtr_name
print -n "You enter printer ${prtr_name}"
print -n " Is this correct Y/N "
read answ
if [[ "$answ" = [Yy] ]]
then
lpstat $prtr_name | grep $prtr_name | sort -k1 | cut -d " " -f1 > $prtr_name.out
for rem_prt in `cat $prtr_name.out`
do
cancel $rem_prt
done
else
echo "No Such Printer"
fi
fi;;
esac
done
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-10-2010 09:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-10-2010 10:04 AM
тАО03-10-2010 10:04 AM
Re: HelpDesk Script
What would be t he easiest way to resolve this? Our new help desk will be using the script and when the log in I would like for them to be able to reset and redo their password. Any help is appreciated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-10-2010 10:14 AM
тАО03-10-2010 10:14 AM
Re: HelpDesk Script
You could also fix their PATH environment variable but that gets a bit more involved.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-10-2010 10:23 AM
тАО03-10-2010 10:23 AM
Re: HelpDesk Script
Regarding the easy way, well, this is a build team or install team or a production team issue. Sudo can be easily installed during first build. It can easily be installed over the network now. Refer to your O/S version and the intenet express bundle for 11.23 and 11.31.
11.23 link
https://h20392.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=HPUXIEXP1123
Sounds like its a project that you'll have to get approval on. A good way to start the ball rolling would be to id the servers needing the install. Do you have access to all?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-10-2010 10:23 AM
тАО03-10-2010 10:23 AM
Re: HelpDesk Script
#This command looks at the account if it has a password liftime expired it will reset the account and enable it
#sudo /usr/lbin/modprpw -x ${USER}
/usr/local/bin/sudo
I am not an expert at writing scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-10-2010 10:26 AM
тАО03-10-2010 10:26 AM
Re: HelpDesk Script
export PATH=$PATH:/usr/local/bin/sudo
Test out the above to see if it's what you want.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-10-2010 10:26 AM
тАО03-10-2010 10:26 AM
Re: HelpDesk Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-10-2010 10:33 AM
тАО03-10-2010 10:33 AM
Re: HelpDesk Script
Would it be in the HelpDesk log in or profile or in the script
If in the script where?
sorry again I am trying to understand this and learn with your assistance
Thanks
-Charlie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-10-2010 10:43 AM
тАО03-10-2010 10:43 AM
Re: HelpDesk Script
The reason I suggested changing the script rather than changing the path is because you first have to figure out how and where the path is being set. You could append a "export PATH=$PATH:/usr/local/bin" statement to the users login profile, but that's going to depend on which shell they are using and how they are logging in.
Edit the helpdesk script and change "sudo" to "/usr/local/bin/sudo".
Pete
Pete