Announcement

Collapse
No announcement yet.

Script to list events that have script actions - Discussion Thread

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • noopara
    replied
    Jon00 - Great solution. Thanks for the tip. That's a simple way to cull out old unused scripts.

    Leave a comment:


  • sparkman
    replied
    Originally posted by noopara View Post
    I'm looking for a script that finds scripts that call other scripts...Actually what I am looking for is a script that identifies scripts that are not used at all. As far as I can tell, your tool finds only scripts that are called in an event.
    It also can find scripts that are not used in any events. However, some scripts are called through other methods, some scripts may only be used very rarely, so there's really no fool-proof way to determine which scripts are never used.

    Leave a comment:


  • jon00
    replied
    Originally posted by noopara View Post
    I'm looking for a script that finds scripts that call other scripts...Actually what I am looking for is a script that identifies scripts that are not used at all. As far as I can tell, your tool finds only scripts that are called in an event.
    I think you use Windows. If so, just add 'Date Accessed' as a column in Explorer for the scripts directory and sort by date.

    Leave a comment:


  • noopara
    replied
    I'm looking for a script that finds scripts that call other scripts...Actually what I am looking for is a script that identifies scripts that are not used at all. As far as I can tell, your tool finds only scripts that are called in an event.

    Leave a comment:


  • zwolfpack
    replied
    Found a couple of things.

    First, the database filename was built with backslash separators, which Linux doesn't accept. Easy fix.

    Next, the crash can eliminated by commenting out the line
    Code:
    Blob = comm.ExecuteScalar()
    in either of the functions 'EventsWithScripts' or 'EventsWithImmediateScriptCommands' that is to be called.

    This is a bit crazy, because that line wasn't ever executed until the path issue was fixed! Seems the crash occurs at interpret/compile time (not run time) of either of those functions. (they are compiled right before being called, so the debugging outputs occur up til that point, then crash).

    I tried some variations, but no success so far. Issue seems conversion to the byte array data type. It does run all the way through (reports the correct number of items found), but the results are incomplete of course.

    It seems that mono is a bit of a mess. The initial message announcing the crash is

    * Assertion at method-to-ir.c:3041, condition `m_class_get_rank (klass) == 0' not met

    I get the same crash running this script

    Code:
    Sub Main(parm as object)
        Dim Blob As Byte()
    
        hs.WriteLog("test", "I exist!")
        Blob = System.Text.Encoding.Unicode.GetBytes(parm)
        hs.WriteLog("test", "I survived the apocalypse!")
    End Sub
    which runs without complaint under Windows. (It doesn't do what I wanted, but thats a different issue...)

    Leave a comment:


  • Guest
    Guest replied
    Sorry to be off topic.

    zwolfpack

    I noticed a diference between the original vbnc patch :

    Code:
    if [[ $x = '/tmp'* ]]
    And the one you just posted
    Code:
    if [[ $x =~ ^/tmp/ && -e $x ]]
    So I wonder what is the difference. Are there any functional/performance difference?
    thank you

    Leave a comment:


  • sparkman
    replied
    Originally posted by zwolfpack View Post
    Gave this a try again tonight with same results.
    Thanks for the detailed testing. Can you also turn on debug in the script as that may give a hint how far it gets and that may pinpoint which call is causing the issue?

    Leave a comment:


  • zwolfpack
    replied
    Gave this a try again tonight with same results. First off, attached are minor changes to scriptevents.aspx

    1) changed all instances of "VbCrLf" with "Environment.NewLine". This was awhile back; presumably the former didn't work on Linux.

    2) At line 78, changed so SQLite.dll can be found.

    /usr/bin/vbnc is patched as follows:
    Code:
    #!/bin/bash
    # mono vbnc invocation script patched for HS3 aspx compatability
    for x
    do
        if [[ $x =~ ^/tmp/ && -e $x ]]
        then
            sed -i '1{/#External/d}' $x
        fi
    done
    exec /usr/bin/mono --debug $MONO_OPTIONS /usr/lib/mono/4.5/vbnc.exe "$@"
    mono version is 6.0.0.313

    =======
    Once the ASPX page loads, selected first dropdown entry... HS3 crashes

    For possible insight to the problem, started HS3 in the foreground (using ./go).

    Crash dump starts with

    Code:
    * Assertion at method-to-ir.c:3041, condition `m_class_get_rank (klass) == 0' not met
    
    
    =================================================================
            Native Crash Reporting
    =================================================================
    Got a SIGABRT while executing native code. This usually indicates
    a fatal error in the mono runtime or one of the native libraries
    used by your application.
    =================================================================
    Full transcript attached.
    Attached Files

    Leave a comment:


  • sparkman
    replied
    Originally posted by larhedse View Post
    Sparkman - is there anyway I could use the vb-script part only and well get a list printed in the Log for example?
    Given the issues that zwolfpack reported, it does not look like that would work either. I'll see if I can spin up my linux laptop and try it there. However, I likely won't be able to do so till late August.

    Leave a comment:


  • larhedse
    replied
    Sparkman - is there anyway I could use the vb-script part only and well get a list printed in the Log for example?

    Leave a comment:


  • Guest
    Guest replied
    Originally posted by larhedse View Post
    Na this has nothing to do with your script - this is clearly a Mono problem. I'll see if MattL0 has something cool to say about it :-)
    Lol same has you . My scripts skills are very basics, if not null.

    Leave a comment:


  • sparkman
    replied
    Originally posted by zwolfpack View Post
    This script is very handy and runs great on Windows. A few months back I attempted to get it running on Linux (HS3-std on Raspberry Pi). I got past the ASPX issues, got the paths straightened out to the point to where it was able to find and try to load the SQLite library. HS3 then stopped completely (crashed). I threw in the towel at that point. Once of several "little" things that convinced me the Linux product isn't ready for prime-time. Pity.
    Thanks for confirming. I'm wondering if the SQLite access to the database killed it? One thing to try is creating a backup copy of the database and then have the script access it instead. An alternate path can be provided in the config for it.

    Leave a comment:


  • zwolfpack
    replied
    This script is very handy and runs great on Windows. A few months back I attempted to get it running on Linux (HS3-std on Raspberry Pi). I got past the ASPX issues, got the paths straightened out to the point to where it was able to find and try to load the SQLite library. HS3 then stopped completely (crashed). I threw in the towel at that point. Once of several "little" things that convinced me the Linux product isn't ready for prime-time. Pity.

    Leave a comment:


  • larhedse
    replied
    Na this has nothing to do with your script - this is clearly a Mono problem. I'll see if MattL0 has something cool to say about it :-)

    Leave a comment:


  • sparkman
    replied
    Originally posted by larhedse View Post
    Applied that fix in post 3 on that thread - no difference. The last post says Mono 6 - but since Mono 6 seems well not advisable to upgrade to...?
    Thanks for trying. Not sure I can do anything to help troubleshoot it as my linux skills are minimal. Appears to be an overall HS/mono issue, and not something specific to my script/aspx file.

    Leave a comment:

Working...
X