DX Unified Infrastructure Management

  • 1.  probe: download whole log file

    Posted Mar 29, 2017 12:18 PM

    Is there any way within UIM to download an entire probe log file?  Major pain to do it in IM Log Viewer if the log is large, and the Download in Admin console doesn't get the whole file.



  • 2.  Re: probe: download whole log file

    Posted Mar 29, 2017 03:07 PM

    In LUA (or other supported language) you can user the controller call back get_text_file.

     

    I've posted the code here before so you should be able to find it. Not hard to figure out from scratch either.

     

    -Garin



  • 3.  Re: probe: download whole log file

    Posted Mar 29, 2017 03:28 PM

    Thanks, Garin.  What I want is something one of our admins can just click on or type while he's looking at a probe (troubleshooting, etc.) to avoid having to go open a shell and use scp or something like.  If he has to go execute a script, it would seem to be just as much trouble as scp.  Or would he be able to launch a script such as you describe from within whatever probe he is working on?



  • 4.  Re: probe: download whole log file

    Posted Mar 30, 2017 08:23 AM

    Hi,

     

    Yes i think we have no other solutions ( in my case i use my own custom scripts to retrieve logs ). Maybe create a idea for this ?

     

    Best Regards,

    Thomas



  • 5.  Re: probe: download whole log file
    Best Answer

    Posted Mar 30, 2017 09:47 AM

    Consider the possibility that if you script the retrieval, that you could fire that script via an AO profile. That would allow you to have that file locally already when the human investigating the issue went to look at it.

     

    This is good too for watching for changes to configuration files and whatnot if you are responsible for equipment/services that other people also have administrative rights to. Very handy when something breaks and you ask the question "Did you change anything?" and get the "No" answer. If you had dirscan in place watching that file for updates and the AO profile set to retrieve the file on the dirscan event, you could save the whole change history and point to exactly where and when that "Unchanged" file changed.

     

    Here's a script that I run as an AO profile that grabs a log based on the contents of an alarm and emails that content to an address

     

    local args = SCRIPT_ARGUMENT
    local a = alarm.get()

    function GetFileName(probe)
    local files = {
    logmon = { dir="probes/system/logmon", file="logmon.log" }
    }

    return files[probe].dir, files[probe].file
    end

    local mypds = pds.create()
    local l
    local output1
    local return_status1
    local directory, filename
    local address = "/" .. a.domain .. "/" .. a.hub .. "/" .. a.robot

    directory, filename = GetFileName(a.prid)

    pds.putString ( mypds, "directory", directory)
    pds.putString ( mypds, "file", filename )
    pds.putInt ( mypds, "buffer_size", 10240000 )

    l = 5
    repeat
    l = l - 1
    output1,return_status1 = nimbus.request ( address .. "/controller", "text_file_get", mypds )
    if ( ( return_status1 ~= NIME_OK ) or ( output1["file_content"] == nil ) ) then
    print (" Retrying list from controller.")
    end
    until ( return_status1 == NIME_OK or l == 0 )
    pds.delete(mypds)

    if ( return_status1 == NIME_OK and ( output1["file_content"] ~= nil )) then
    action.email ("your.email@domain.com" , "GetLogFile testing", output1["file_content"])
    end

     

    Hope this helps

     

    -Garin



  • 6.  Re: probe: download whole log file

    Broadcom Employee
    Posted Apr 05, 2017 09:45 AM

    Hello William, you can open the AdminConsole and select the probe you want to download the logfile. Click to the 3 buttons left to the probe name and select "View Logfile". From the Action Tab select "Download Log".

     

    Kind regards,

    Britta Hoffner