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:
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:
Еhanks in advance.
Solved! Go to Solution.
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.
In that case and for cronjobs I simply include nasadmins profile into the script:
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
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.
login as nasadmin into the box
> mkdir /home/nasadmin/bin
> chmod 755 /home/nasadmin/bin
create a scriptfile /home/nasadmin/bin/do_nas_cel:
/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.
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.
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.
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.
You cant get Replicator info via XMLAPI
For scripting I recommend the (undocumented) nas_replicate –report option
nas_replicate –report it is interesting command, but how it helps me?
[nasadmin@MiK_emulator_01 ~]$ nas_replicate -report
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.