1

Plugin SNMP on BA:Connected (Resolved)

Hello Community,

I'm trying to get this SNMP plugin to run properly on an XT5 but can't get it to retrieve information about the player (Player's name, Description, Uptime, etc). 

Some parameters may have changed since it's a plugin made for the old Brightauthor, so I tried to change them but with no success.

I'm new to Brightscript and I see little information about this topic.

Hope we can get this to work in one way or another.

 

Link for the presentation with plugin:

https://www.mediafire.com/file/itc53z41diqmc41/SNMP_Plugin_for_XT5.zip/file

 

Thanks,

PB

10 comments

  • 1
    Avatar
    Bright Scripters

    Does this plugin work for you without issues with the old BrightAuthor and on players of earlier generation than XT5?

    Have you tried publishing to XT5 using BrightAuthor Classic?

  • 1
    Avatar
    Bright Scripters

    Seems to be working on HD5 (OS9), published from BrightAuthor Classic. It only started to work after a player reboot...

    What tool are you using to read SNMP from the player?

  • 0
    Avatar
    Pablo Billar

    Hi,

    Yes, BrightAuthor Classic works, but the issue comes when you try it with BA: Connected. 

    I use the same program as you. Paessler SNMP Tester.

    Sadly, our project requires us to use BA: Connected with this plugin... 

  • 1
    Avatar
    Bright Scripters

    Have you tried with player gerneration earlier than gen 5?

  • 0
    Avatar
    Pablo Billar

    Yes, with an HD224. No luck with this one. But it does work with the older BrightAuthor.

    Did notice with the Brightscript debugger that some errors occur.

    Maybe because the code had changed from BrightAuthor Classic to the new one...

  • 1
    Avatar
    Bright Scripters

    How refreshing it is to see the debugger prompt in this forum... :)

    It seems like the new autorun doesn't have .unitname$ key.

    You could remove the dependency on how the autorun does things, and get the unit name directly from the registry like so:

    name$ = CreateObject("roRegistrySection", "networking").read("un")

     

  • 0
    Avatar
    Pablo Billar

    :D

    Okay. Been testing but can't get it to work properly.

    Perhaps I'm not understanding what you said.

    Where exactly do you mean I should put this code? 

    In the Autorun.brs? If so, where?

     

    Here is what I did:

    Tried to put in in the Sub Main() but nothing.

    Later I put it in the plugin like this:

    Function CheckNameStatus()As string

        PlayerName$ = ""

        PlayerName$ = CreateObject("roRegistrySection", "networking").read("un")

        'if m.bsp.registrysettings.unitname$ <> invalid then
            'PlayerName$ = m.bsp.registrysettings.unitname$
            'm.agent.SetOidValue("1.3.6.1.4.1.2021.9.1.9.4", PlayerName$)
        'end if

        return PlayerName$
       
    End Function

    Also did this for the functions for player description (ud) and IP(sip). Like this I had no errors, but still couldn't retrieve the correct information.

    One thing I did notice is that in the Debugger, when I print PlayerName$ it returns as UNINITIALIZED.

     

    PD: Sorry if I'm doing dumb questions, I'm still trying to get the hand of this.

  • 1
    Avatar
    Bright Scripters

    You should not attempt to modify the autorun, so all code would go into the plugin.

    The function would look like this:

     

    Function CheckNameStatus()As string
    PlayerName$ = CreateObject("roRegistrySection", "networking").read("un")
    m.agent.SetOidValue("1.3.6.1.4.1.2021.9.1.9.4", PlayerName$)
    return PlayerName$
    end function
  • 0
    Avatar
    Pablo Billar

    Oh, you're right. My bad.

    Now it's working without flaws. 

    Big thanks for the help! 

     

    Here is the plugin if anyone wants to use it with the new players (Series 5)/newer software (V1.32).

    →→  Plugin link  ←←

    Set the plugin name when you add it to the presentation to Custom.

  • 0
    Avatar
    Bright Scripters

    Good job!

    Thanks for sharing too.

Please sign in to leave a comment.