This post is more than 5 years old
14 Posts
0
6209
EMC_Celerra emulator: problem with "nas_cel" command via SSH
Hello.
I have a problem! During using EMC_Celerra 6.0.36-4 emulator I have found that "nas_cel" command via SSH is not work properly.
While connecting from my software using SSH to EMC Celerra server with login nasadmin or root and trying to execute command "/nas/bin/nas_cel -interconnect -list" I have a response "NAS_DB environment not defined". At the same time the command "/nas/bin/nas_cs -info" works properly from my software and I receive normal responce.
I tried to add the following to the /etc/environment file in EMC server:
PATH=/nas/bin
export NAS_DB=/nas
and the responce to the command "/nas/bin/nas_cel -interconnect -list" was the following:
"id name source_server destination_system destination_server Error 10234: data mover : server_2 is not responding".
But if I use directly the command line of EMC server for the same commands everything works properly.
This is a part of result of command "env" in my EMC server:
"PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/nasadmin/bin:/nas/bin
INPUTRC=/etc/inputrc
PWD=/home/nasadmin
LANG=en_US.UTF-8
SHLVL=1
HOME=/home/nasadmin
NAS_DB=/nas
LOGNAME=nasadmin
"
Еhanks in advance.
MichaelKuznetsk
14 Posts
0
November 15th, 2012 03:00
Hello all.
I fixed my problem with "NAS_DB environment not defined". I insert "NAS_DB=/nas " before my command and it is worked. I use libssh2 and it is set up environment not correctly, I think.
Thank you guys for help.
urle
48 Posts
0
October 25th, 2012 01:00
In that case and for cronjobs I simply include nasadmins profile into the script:
local_script:
#!/bin/sh
. /home/nasadmin/.bash_profile
server_export server_2 .P cifs -l
Then use ssh nasadmin@celerra:local_script
or - if you want to keep the env locally:
enable PermitUserEnvironment in ssh_config
add environment file with VAR=VALUE in .ssh directory
urle
MichaelKuznetsk
14 Posts
0
October 25th, 2012 02:00
Hello, urle.
Thanks for the reply.
Unfortunately I do not understand your answer exactly. What happens after the commands "server_export server_2 .P cifs -l" ? How it helps me to execute "nas_cel" command?
Can you answer with more details because I'm not good understanding in Linux and ssh.
urle
48 Posts
0
October 25th, 2012 02:00
login as nasadmin into the box
> mkdir /home/nasadmin/bin
> chmod 755 /home/nasadmin/bin
create a scriptfile /home/nasadmin/bin/do_nas_cel:
#!/bin/sh
. /home/nasadmin/.bash_profile
/nas/bin/nas_cel -interconnect -list
> chmod 755 /home/nasadmin/bin/do_nas_cel
Then from the external box use the command
# ssh nasadmin@your_celerra:/home/nasadmin/bin/do_nas_cel
and you should see the expected output.
Cheers, urle
MichaelKuznetsk
14 Posts
0
October 25th, 2012 04:00
Thanks for your answer.
I did what you advised me. I see that the script works correctly but in my program I receive in response an empty string. I think the problem in ssh library or in my code that uses this library.
I want to ask you one more question. Can I get interconnect id (like "nas_cel -interconnect -list") by other way? For example by xml api or other command by ssh..? I need this id for "nas_copy" checkpoint.
Best regards,
Michael.
urle
48 Posts
0
October 25th, 2012 04:00
Did you try it from commandline on the external host? If you've got output by the nas_cel command when invoked directly via your code you should see some output when invoking the script.
For xml-api I have to pass over - I did it never by myself.
Sorry, urle
MichaelKuznetsk
14 Posts
0
October 25th, 2012 05:00
When I connect by ssh in.. "mRemoteNG" for example - I see correct output from commands nas_cel, /nas/bin/nas_cel, from your script.. from any command and with any login(root, nasadmin). But from my code - empty output by the nas_cel -interconnect -list
Trying to find a problem..
Thank you, urle.
Rainer_EMC
8.6K Posts
0
October 25th, 2012 06:00
Not for nas_cel info – its just easier to parse than the regular output
I dont think your problem is in the VNX functionality – its either ssh config or your programming
umichklewis
1.2K Posts
0
October 25th, 2012 06:00
nas_replicate -report generates a list of all replication sessions, separated by commas. If you import this into Excel and delimit on the commas, you get nice columns describing the state of every replication session (filesystem, VDM, loopback, etc.), including the Celerra interconnects used by each replication. Granted, you will only see the interconnects for which you have active replications configured, so you won't see anything for interconnects that exist, but have no replications set up.
Rainer_EMC
8.6K Posts
0
October 25th, 2012 06:00
You cant get Replicator info via XMLAPI
For scripting I recommend the (undocumented) nas_replicate –report option
MichaelKuznetsk
14 Posts
0
October 25th, 2012 06:00
Hello, Rainer_EMC.
nas_replicate –report it is interesting command, but how it helps me?
[nasadmin@MiK_emulator_01 ~]$ nas_replicate -report
"id","name","object","remoteSystem","dartInterconnect","peerInterconnect","localRole","sourceMover","sourceInterface",
"destinationMover","destinationInterface","isCopy","destinationDataPort","destinationControlPort","sourceControlPort",
"sourceStatus","destinationStatus","networkStatus","maxTimeOutOfSync","lastSyncTime","nextTransferSizeKB",
"curTransferRateKB","curReadRateKB","curWriteRateKB","curTransferTotalSizeKB","curTransferRemainSizeKB",
"curTransferEstEndTime","curTransferIsFullCopy","curTransferSourceDataPort","prevTransferRateKB",
"prevReadRateKB","prevWriteRateKB","avgTransferRateKB","avgReadRateKB","avgWriteRateKB","sourceFilesystem",
"destinationFilesystem","sourceVdm","destinationVdm","sourceLun","destinationLun","sourceTarget","destinationTarget",
"appData","latestSrcSnap","latestDstSnap","curTransferSnap","waitingSnaps","internalSnaps"
Rainer_EMC
8.6K Posts
1
October 25th, 2012 07:00
Because most the nas_ and server_command need the variable NAS_DB to be defined properly to work.
Please see the appendix of the command reference guide for file called scripting guidelines
There usually also is some info the release notes
MichaelKuznetsk
14 Posts
0
October 25th, 2012 07:00
Thank you gentlemens.
I agree with Rainer_EMC - problem with my ssh library or code. In this discussion I just wanted to clarify 3 questions:
1. Why the sEMC erver can respond to me "NAS_DB environment not defined" when I send command "/nas/bin/nas_cel -interconnect -list" by ssh.
2. Why the sEMC erver can respond to me "Error 10234: data mover : server_2 is not responding" when I send command "/nas/bin/nas_cel -interconnect -list" by ssh(server_2 is all right).
3. How I can see interconnect id except "nas_cel -interconnect -list". Karl answered this question, but I may can't any replication session in target EMC server.