DX Unified Infrastructure Management

  • 1.  NAS Script - Using action.command()

    Posted Mar 13, 2008 09:18 AM
    I'm trying to have a NAS script run a batch script I have on the Main HUB ( script is located on same server as nas ).
    This batch script runs from the commandline: c:\NASCOM\test.bat with expected results.
    I'm trying to run inside a NAS script using action.command(c:\NASCOM\test.bat)
    but I get no output error or otherwise and I know it is not calling the script. Anyone have an example of code calling an action.command?


  • 2.  NAS Script - Using action.command()
    Best Answer

    Posted Mar 14, 2008 03:24 AM
    Figured out the problem,  I needed to double the forward slash in the varable:

    Command: c:\batch.bat"

    Solution:
    CMD="c:\\batch.bat"
    action.command(CMD)



  • 3.  NAS Script - Using action.command()

    Posted Mar 21, 2008 06:03 AM
    I am just using the lua io module below is a snipet that will do a snmpget.

    cmd = "snmpget -v1 -c nQnuCTT -t 1 -O  qv "..name2.." "..oid..""
    --print (cmd)

    if action.ping(name2) then
        action.visibility(false,nid)
        local f = io.popen(cmd)
        local lout = f:read("*a")
        --print(lout)
        f:close()

    Or you can do the below which is the file is on a linux server
    cmd = "/opt/nimbus/bin/confbkup.py "..hosts..""

    lout = cmdout(cmd)

    cmdout is a function()
    function cmdout (cmd)
       local f = io.popen(cmd)
       local lout = f:read("*a")
       f:close()
       return lout
    end


  • 4.  NAS Script - Using action.command()

    Posted Mar 21, 2008 06:09 AM
    Quote: (neal.timm@trillion.net)
    I am just using the lua io module below is a snipet that will do a snmpget.


    cmd = "snmpget -v1 -c nQnuCTT -t 1 -O  qv "..name2.." "..oid..""

    --print (cmd)


    if action.ping(name2) then

        action.visibility(false,nid)

        local f = io.popen(cmd)

        local lout = f:read("*a")

        --print(lout)

        f:close()


    Or you can do the below which is the file is on a linux server

    cmd = "/opt/nimbus/bin/confbkup.py "..hosts..""


    lout = cmdout(cmd)


    cmdout is a function()

    function cmdout (cmd)

       local f = io.popen(cmd)

       local lout = f:read("*a")

       f:close()

       return lout

    end