Run nmon on other server through script


 
Thread Tools Search this Thread
Operating Systems AIX Run nmon on other server through script
# 1  
Old 05-29-2011
Run nmon on other server through script

Hai All,

Iam new to AIX unix. Im just tryin to automate my monitoring work and hence i have writen a basic script in which i am running nmon on multiple nodes from a main node.

say for ex: From server a :
ssh server b nmon -MB -s1 -c1 > nmon_now.txt

gave the password and result I got was

unknown Terminal is Unknown.

Whats going on. Can some one help me plz. I am egar to know what mistake im doing.
Please correct me.

Warm Regards,
Jayadeava
# 2  
Old 05-29-2011
Quote:
Originally Posted by jayadeava
Hai All,

Iam new to AIX unix. Im just tryin to automate my monitoring work and hence i have writen a basic script in which i am running nmon on multiple nodes from a main node.

say for ex: From server a :
ssh server b nmon -MB -s1 -c1 > nmon_now.txt

gave the password and result I got was

unknown Terminal is Unknown.

Whats going on. Can some one help me plz. I am egar to know what mistake im doing.
Please correct me.

Warm Regards,
Jayadeava
Hello,

This is happening because your are using nmon in interactive mode switch it to make something like one snapshot for 1 second and exit (check nmon -h).
This User Gave Thanks to click For This Post:
# 3  
Old 05-30-2011
Thanks for the replay.
I have tried creating a script on server B which included as

Code:
export NMON=m
 
nmon -MB -s1 -c1 > nmon_now.txt

a=`grep -b Paging nmon_now.txt | awk '{print $12}' | cut -c 1-4`
b=`grep -b File nmon_now.txt | grep -v pages/sec | awk '{print $13}' | cut -c 1-4`
c=`grep -b Scans nmon_now.txt | awk '{print $10}' | cut -c 1-4`
d=`grep -b Cycles nmon_now.txt | awk '{print $8}' | cut -c 9-11`
e=`echo " $b + $c + $d " | bc`

echo " % Comp    = " $e
echo " % Noncomp = " $a
echo " % Client  = " $a

then I ran
Code:
ssh server B /home/asdf/above_script.sh

passwd given
it excuted that script on server B but i got null value as a result.


warm regards,
Jayadeava

Last edited by pludi; 05-30-2011 at 06:24 PM..
# 4  
Old 05-31-2011
Sorry for asking but currently I don`t have access to any AIX node(will have later this week) so I cannot test it but:

Does

Code:
ssh server_B 'nmon -MB -s1 -c1'

work normal?

If it works normal try to execute the script in debug mode/ run it locally to test it out - output will be helpful.

note: for ksh you can put

Quote:
set -x
In the beginning of you script or use

Code:
ssh server_b  'ksh -x /home/asdf/above_script.sh'

# 5  
Old 05-31-2011
A couple of things to think about:

Run nmon or 24 hours on a node. Use something like:
Code:
$NMON_EXECUTABLE -F $WORK_DIR/$NMON_LOG_FILE -s $DELAY -c $COUNT

Run the above from cron, with:
/home/unxsa/bin/collect_nmon_perf_data 898 96

DELAY=898 COUNT=96

Then use nmon analyzer to produce reports.

This doesn't give you instant monitoring of course.
# 6  
Old 05-31-2011
Quote:
Originally Posted by click
Code:
ssh server_B 'nmon -MB -s1 -c1'

IIRC you start nmopn in daemon mode with the "-F" parameter. Without it nmon will always come out in interactive mode, regardless of where you direct its output.

I hope this helps.

bakunin
This User Gave Thanks to bakunin For This Post:
# 7  
Old 05-31-2011
Thanks every one for valuable inputs and ideas... Of course its helpfull

Warm Regards,
Jayadeava
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Except script to run a local shell script on remote server using root access

local script: cat > first.sh cd /tmp echo $PWD echo `whoami` cd /tmp/123 tar -cvf 789.tar 456 sleep 10 except script: cat > first #!/usr/bin/expect set ip 10.5.15.20 set user "xyz123" set password "123456" set script first.sh spawn sh -c "ssh $user@$ip bash < $script" (1 Reply)
Discussion started by: Aditya Avanth
1 Replies

2. UNIX for Dummies Questions & Answers

Script to run in vio server

I want to grab all the luns in vscsi disks from vio that are assigned to client lpars. They are not powerpath disks. Now when I do lspv as root in vio server I see 956 disks..the problem right now is that each disks lun are in hex so when I do lscfg vpl from vio..the FRU number is on hex. Can... (3 Replies)
Discussion started by: pregmi
3 Replies

3. Shell Programming and Scripting

Need script to run the command in remote server

hi, I need script to perform below task. 1. Read the IP address 2. copy the script from origin server to destination. 3. get root access on destination server 4. run the script on destination server 5. return to the origin server Code: #!/bin/bash echo "Enter Server IP... (5 Replies)
Discussion started by: bapu1981
5 Replies

4. Shell Programming and Scripting

Need help on how to exit a script run on a server from a remote server

hi, I am using the below line to run a script from remote server(say server A) to another server(say server B). ssh username@servername ksh script name. The issue is the script logs into server B, executes the script on server B, transfers the file to server A but does not exit from... (4 Replies)
Discussion started by: yohasini
4 Replies

5. Programming

Expect script to run a Shell script on remote server

Hi All, I am using a expect script to run a shell script on remote server, the code is as follows. But the problem is that it executes only first command, and hangs it doesn't run the next commands. spawn ssh $uid@$host expect "password:" send "$password\r" expect "*\r" send... (2 Replies)
Discussion started by: yashwanthsn
2 Replies

6. Shell Programming and Scripting

Run script from another server

If i have one server processing some feeds and creating a database. Then i want to copy the relevant tables from the first server to the second server. I have a shell script to do the copy. I was going to make a cron to run the script at a certain time. But it would not be ideal. I really want... (8 Replies)
Discussion started by: timgolding
8 Replies

7. Shell Programming and Scripting

How can i run script on other server.

Hi guys , I want to run a specific command from one server to another. For example I have a server called A(client) and a server called B(Server). How would i fire a command on Server(B) while working on Client(A). One way of doing it is using ssh "ssh -tq 10.180.8.231 ls -ltr" but... (3 Replies)
Discussion started by: pinga123
3 Replies

8. UNIX for Advanced & Expert Users

NMON Physical Averages display for multi CPU Server

We have some AIX Unix Servers with 4 or 6 CPU and when type this command “c” in nmon always displays each cpu % with Averages on buttom. However we have several Servers with 18 CPU's and it only shows 16 17 on main page. Does nmon have some command that would show remaining with totals for Physical... (3 Replies)
Discussion started by: groosha
3 Replies

9. Shell Programming and Scripting

Run Script With nohup Command On A Different Server

Hi, I want to run a particular script present in a different server. At the moment I am trying to run it like this: (sleep 3; echo $USERID; sleep 1; echo $PASSWORD ; sleep 1 ; sleep 1 ; echo "nohup perl myscript.pl $* &")| telnet "$server" But the problem is that once the script has... (6 Replies)
Discussion started by: King Nothing
6 Replies

10. Solaris

I want to run a script or command on other server

Hi all, I have done ssh-keygen to two servers in work place and given there entry for authorized_keys. I m able to ssh to other servers without asking password. But i face problem while trying to run a command or script on other server. It is throwing an Error. $ ssh... (4 Replies)
Discussion started by: naree
4 Replies
Login or Register to Ask a Question