TechnoGeek

LUA probe executs differently depending on how it is run.... why?

Discussion created by TechnoGeek on Apr 25, 2012
Latest reply on Apr 25, 2012 by TechnoGeek

Hi All,

 

I have written a new probe in LUA to monitor some filesystem sync times which appears to work fine, but only if I run the script via the command line and with the nsa "-D" option and I do not understand why this is happening and would appreciate any advice...

 

The LUA code as it exists for this test (there is quite a bit of debug code in here that will get cleaned up in the final version - the cmdout function was tried, with similar results) is attached.

 

 

I have deployed the probe to a specifc robot that also has the nsa (version 2.01) installed. When I run the probe from the command line as follows "..\..\..\sdk\nsa\nsa.exe celerra_sync.lua", the results are as follows (IP's, usernames and passwords are obfuscated) :

 

Apr 24 13:51:56:789 celerra_sync: ****************[ Starting ]**************** Apr 24 13:51:56:789 celerra_sync: celerra_sync 1.0 Apr 24 13:51:56:789 celerra_sync: marc d behr, 2012 Apr 24 13:51:56:789 celerra_sync: ReadIntermediateServerCertificate - NIM_ROOT not set Apr 24 13:51:58:974 celerra_sync: port=23293 PID=22564 Apr 24 13:51:58:974 celerra_sync: Starting celerra_sync Apr 24 13:51:58:974 celerra_sync: Reading celerra_sync.cfg Apr 24 13:51:58:974 celerra_sync: reading devices Apr 24 13:51:58:974 celerra_sync: reading System1 Apr 24 13:51:58:974 celerra_sync: reading setup data Apr 24 13:51:58:974 celerra_sync: Done reading config Apr 24 13:51:58:974 celerra_sync: running - "c:\\Program files (x86)\\nimsoft infrastructure\\probes\\glasshouse\\celerra_sync\\plink.exe" -batch AA.BB.CC.DD -l XXXXX -pw XXXXX  /nas/bin/nas_replicate -info -all Apr 24 13:52:55:529 celerra_sync: Found date 2012-Apr-24 13:56 Apr 24 13:52:55:529 celerra_sync: Found name = vdm_rfaxjmfcifsp08_rep Apr 24 13:52:55:529 celerra_sync: Found date 2012-Apr-24 13:58 Apr 24 13:52:55:529 celerra_sync: Found name = Rfax_fs1 Apr 24 13:52:55:529 celerra_sync: Found date 2012-Apr-24 13:47 Apr 24 13:52:55:529 celerra_sync: Found name = Rfax_fs1_rep2 Apr 24 13:52:55:529 celerra_sync: Found date 2012-Apr-24 13:45 Apr 24 13:52:55:529 celerra_sync: Found name = ALP_Users_VDI_fs1_rep Apr 24 13:52:55:529 celerra_sync: Found date 2012-Apr-24 13:57 Apr 24 13:52:55:529 celerra_sync: Found name = vdm_alpsfilp8_rep Apr 24 13:52:55:529 celerra_sync: Found date 2012-Apr-24 13:59 Apr 24 13:52:55:529 celerra_sync: Found name = JMSC_VM_TEMPLATES_FS2_rep Apr 24 13:52:55:529 celerra_sync: Found name = JMSC_VM_TEMPLATES_FS2_rep2 Apr 24 13:52:55:529 celerra_sync: Found date 2012-Apr-24 13:49 Apr 24 13:52:55:529 celerra_sync: Found name = JMSC_VM_TEMPLATES_FS3_rep Apr 24 13:52:55:529 celerra_sync: Found date 2012-Apr-24 13:50 Apr 24 13:52:55:529 celerra_sync: Found name = JMSC_VM_TEMPLATES_FS4_rep Apr 24 13:52:55:529 celerra_sync: Found name = JMSC_VM_TEMPLATES_FS3_rep2 Apr 24 13:52:55:529 celerra_sync: Found date 2012-Apr-24 13:48 Apr 24 13:52:55:529 celerra_sync: Found name = JMSC_VM_TEMPLATES_FS4_rep2 Apr 24 13:52:55:529 celerra_sync: Found name = ALP_Users_VDI_fs2_rep Apr 24 13:52:55:529 celerra_sync: Found name = vdm_chisfilp8_rep Apr 24 13:52:55:529 celerra_sync: Found name = CHI_Users_VDI_fs2_rep Apr 24 13:52:55:529 celerra_sync: Found date 2012-Apr-24 14:00 Apr 24 13:52:55:529 celerra_sync: Found name = CHI_VDIHome_fs1_rep Apr 24 13:52:55:529 celerra_sync: Found date 2012-Apr-24 13:53 Apr 24 13:52:55:529 celerra_sync: Found name = ALP_VDIHome_fs1_rep Apr 24 13:52:55:529 celerra_sync: Found name = CHI_Users_VDI_fs1_rep Apr 24 13:52:55:529 celerra_sync: Found date 2012-Apr-24 13:52 Apr 24 13:52:55:529 celerra_sync: Finished celerra_sync 

 


Which seems like it sorta works, but not 100%. Now if I execute the same thing from the command line, but this time pass the '-D' flag to nsa, but then simply run the program by typing 'c' , the results are as seen in the attached good_output.log. This looks like exactly what I would expect the log to look like... all of the filesystems were found and reported on

 

Now, again, running the exact same code, but this time by activating the probe, I get:

 

Apr 24 07:59:17:440 celerra_sync: ****************[ Starting ]****************  Apr 24 07:59:17:440 celerra_sync: celerra_sync 1.0  Apr 24 07:59:17:440 celerra_sync: marc d behr, 2012  Apr 24 07:59:18:454 celerra_sync: port=48020 PID=27160  Apr 24 07:59:18:454 celerra_sync: Starting celerra_sync  Apr 24 07:59:18:454 celerra_sync: Reading celerra_sync.cfg  Apr 24 07:59:18:454 celerra_sync: reading devices  Apr 24 07:59:18:454 celerra_sync: reading System1  Apr 24 07:59:18:454 celerra_sync: reading setup data  Apr 24 07:59:18:454 celerra_sync: Done reading config  Apr 24 07:59:18:454 celerra_sync: running - "c:\\Program files (x86)\\nimsoft infrastructure\\probes\\glasshouse\\celerra_sync\\plink.exe" -batch AA.BB.CC.DD -l XXXXX -pw XXXXX /nas/bin/nas_replicate -info -all  Apr 24 07:59:19:499 celerra_sync: in OK loop  Apr 24 07:59:19:499 celerra_sync: Script error, celerra_sync.lua:78: attempt to concatenate field '?' (a nil value) 

 

I am not sure why I am getting three diferent results for the same code (and this is very consistent), so any pointers would be appreciated...

 

Thanks!

 

Marc

Attachments

Outcomes