Sponsored Content
Top Forums Shell Programming and Scripting IF $USER is not in this list of users, then do this Post 302361985 by glev2005 on Wednesday 14th of October 2009 03:36:21 PM
Old 10-14-2009
What does $? indicate? What is this the varible of?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

su - user... how to find out the list of users and their passwords..

hi, to do a su - user, we need to know what are the users... so in unix 1) which file to see the list of users, passwords? (2 Replies)
Discussion started by: yls177
2 Replies

2. AIX

Script allows user to kill other users: I'd like to know HOW...

Hello list, Have a problem that's highlighting gaps in my knowledge; can you assist? We have a script that's tacked onto our trading application which allows branch managers etc. to kill off the sessions of other users at their branch. A menu option in the application spawns a shell running... (8 Replies)
Discussion started by: alexop
8 Replies

3. AIX

cloning users access with different user name

Hi! this would be my first time to post here in this forums, hope you can help me with my queries. i would like to create a different user name but have the same access rights. Example: root > rootbaby. thanks (5 Replies)
Discussion started by: HPL1706
5 Replies

4. UNIX for Dummies Questions & Answers

User Name and Password List/adding and removing users.

Hello everyone and let me start off by thanking anyone who can help with this. I work for a company that uses Unix as one of their servers. I'm not at all familar with Unix beyond logging after I restart the server:rolleyes: I'm looking for some command that will bring me up a list of current... (3 Replies)
Discussion started by: disgracedsaint
3 Replies

5. Shell Programming and Scripting

script to ignore the user from list of users

Hi, I have a situation where I want to ignore few users from list of users and print rest of user in log file. say, I want to ignore aaa, bbb, ccc, ddd .. ppp from list of 20 user (do not want to include) What is the good command or any script? Thanks in advance. (1 Reply)
Discussion started by: sumit30
1 Replies

6. UNIX for Advanced & Expert Users

list of users

Hello!Does anybody know how to solve this script: ,,write a shell script which displays a list of names of users who have created files "*. c" in the last day."? (1 Reply)
Discussion started by: theodoraa
1 Replies

7. UNIX for Dummies Questions & Answers

Not able to switch to other users using su -user from root

Hi all, I have a small problem. When I log in as root and try to switch to any other user using su -user, then it is giving an error saying libncurses.so permission denied. Can you help me? Thank you in advance. Sai. (1 Reply)
Discussion started by: sai2krishna
1 Replies

8. UNIX for Advanced & Expert Users

Need to find the user id of all users in UNIX

I need to find all the unix user id's of all the users in unix... is there any such command... pl help out (6 Replies)
Discussion started by: Syed Imran
6 Replies

9. UNIX for Dummies Questions & Answers

Users list

Hi i would like to know were the folder that contain file with list of all users ? And were i can learn about what kind of folder i have and wheat they have inside? question 2. when i write ls -a i see all directories and then i choose for example Documents and inside Documents i typed again... (1 Reply)
Discussion started by: iliya24
1 Replies

10. Shell Programming and Scripting

List the Manager of Users in AD - Using list- Get-ADuser

Is there any command that can used in Linux that export usernames and their manager's name from AD using bash shell script? I know this can be done using powershell but I need to use Linux for this procedure. (2 Replies)
Discussion started by: dellanicholson
2 Replies
FENCE_NA(8)						User Contributed Perl Documentation					       FENCE_NA(8)

NAME
fence_na This is the fence agent for the Node Assassin fence device. SYNOPSIS
fence_na -a fence_na01.domain.com -n 2 -l admin -p secret -o off DESCRIPTION
This fence agent takes argument from the command line or from the 'fenced' program and interprets them into calls to send to the Node Assassin fence device. It analyzes the returned information and exits with an appropriate exit code as dictated by the FenceAgentAPI. USAGE
Arguments are read from STDIN as 'variable=value' pairs, one pair per new line. This is the method used by 'fenced'. For testing or manual control, arguments may be passed as command line arguments. OVERVIEW
This takes arguments that defined which Node Assassin to call, what node to work on and what action should be taken. These arguments are defined by the FenceAgentAPI. These actions are then translated into a set of Node Assassin states which then get passed to the device. NODE ASSASSIN ";PORTS" The FenceAgentAPI refers to "ports" while the Node Assassin refers to "nodes". These two terms are thus used interchangably. The reason for the difference is that, internally, Node Assassin maps each node to three "ports"; The node's power and reset buttons plus the node's power feed. Each node in the Node Assassin can be set to one of four states described in the next section. NODE ASSASSIN STATES
Each Node Assassin port can be set to one of four states. They are: 0 This will release the fence on the specified NA node's power and reset ports. 1 This state will fence the node specified by the "port" argument. The fence will remain active until released. Further, the fence will "lock out" the node's front-panel buttons until the fence is released. 2 This will fence the node for one second. This is meant to provide a mechanism to boot or initiate a clean shut down of a node. 3 This state will fence the node for five seconds to 30 seconds, depending on how long it takes for the power feed to drop low. This is meant to provide a way to force crashed nodes to power off without the front-panel lock. OPTIONS
Which options are valid depends on how the arguments are passed in. The "main" method of passing arguments is via STDIN as a series of 'varible=value' pairs, one per line. All arguments accepted this way have command-line arguments passed in via single-dashes switches. Each option below shows either calling method's arguments, where available. "-h" Prints this help message. "-v", "-V" Prints the version of this fence agent and then the version of any configured, reachable Node Assassins. "-q" Tells this fence agent to only print critical messages. "-d" Tells this fence agent to print debug messages. "-a address", "ipaddr=address" Tells the fence agent which Node Assassin to use. NOTE! The name or IP addresses *MUST* match a name or IP address defined in "/etc/cluster/fence_na.conf"! Specifically, it must match one of the "node::X::ipaddr" entries where "X" is the ID of the Node Assassin. "-l name", "login=name" This is the login name used to connect to this fence agent. It must match the value "system::username" in "/etc/cluster/fence_na.conf". "-p secret", "passwd=secret" This is the login password used to connect to this fence agent. It must match the value "system::password" in "/etc/cluster/fence_na.conf". "-n #", "port=#" This tells the fence agent which node to act on. NOTE! Please do not confuse this with the Node Assassin's internal concept of a port. "-o val", "action=val" This is the "action" (formerly "option") to perform on the selected node. Valid actions and how Node Assassin implements them are: "off" This set's the node to state 1; Fenced. Internally, it will hit the reset switch for one second to immediately disable the node. Then it will release the reset switch for another second before pressing and holding the power switch. After five seconds, Node Assassin will check the node's power feed. If it is still on, it will wait another 25 seconds and check again. If the node is still on, an error will be generated. If the node turns off successfully, the fence is declared a success. reboot "on" This sets the node to state '0'; Unfenced. Both the power and reset switches are opened, the Node Assassin will pause for one second and then the power switch will be closed for one second to boot the node (that is, the node is set to "state 2"). "reboot" Note: This will do a hard reboot! Do not use when a normal restart would suffice. This essetially just calls an "off" and then an "on". However, the fence_na agent will return a success (exit 0) even if the "on" stage succeeded. As per the FenceAgentAPI, a reboot does not need to successfully boot the node to be concidered a success, it only needs to shut it down. "status" This checks the power feed for the requested node is checked. If the node is on, the agent will exit with code 0. If the node is off (or disconnected), it will exit with code 1. If an error occurred calling the Node Assassin, this will exit with code 2. Note that this argument is designed to be used by the fence agent and will not print any output to "STDOUT". "monitor", "list" Node Assassin Specific Actions NOTE: The following states are supported by Node Assassin only. These states are not used by the "fenced" daemon and are provided here as a convenience for the user. Any commands named *_all ignore the node value, if set. "release" If the node is fenced, the fence will be released. The difference from "on" being that this will not boot the node after the fence is released. "release_all" This does a "release" on all fenced nodes. "fence_all" All nodes are fenced. See the "off" state above. "boot" The power feed of the specific node on the Node Assassin is checked. If it is found to be off, it will be set to state 2 to initiate boot. "boot_all" The power feeds of all nodes on the Node Assassin are checked. Any found to be off are set to state 2 to initiate boot. "shutdown" The power feed of the specific node on the Node Assassin is checked. If it is found to be on, it will be set to state 2 to initiate an ACPI-induced soft shutdown. "shutdown_all" The power feeds of all nodes on the Node Assassin are checked. Any found to be on are set to state 2 to initiate an ACPI-induced soft shutdown. "forcedown_all" The power feeds of all nodes on the Node Assassin are checked. Any found to be on are set to state 3. This state is similar to state 1 (see ""off"" above), except that the node's front-panel switches are not disabled after the fence completes. EXAMPLES
To simulate how 'fenced' calls the script, create a text file called "args.txt" containing: # Test file used as input for the NA fence agent. ipaddr=fence_na01.domain.com port=02 login=admin passwd=secret action=reboot Now use "cat" to pipe the contents into the fence agent: cat args.txt | fence_na This will call the "off" function against node #02 connected to the Node Assassin at "fence_na01.domain.com", fencing it. Change the "action" line to "action=on" and re-run the script to release the fence and boot the node. To duplicate the same call using command line arguments: fence_na -a fence_na01.domain.com -n 2 -l admin -p secret -o reboot SEE ALSO
http://nodeassassin.org UPDATED
Nov. 27, 2010 Digimer (digimer@alteeve.com) perl v5.14.2 2011-11-24 FENCE_NA(8)
All times are GMT -4. The time now is 06:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy