Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

D

DrCamel

@DrCamel
Unfollow Follow
About
Posts
5
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • NXSL Script - Get DCI Comments?
    D DrCamel
    Support

    Ok, thanks again Victor.


  • NXSL Script - Get DCI Comments?
    D DrCamel
    Support

    Excellent, thanks Victor!

    Is there any work around in the meantime? aside from using custom attributes instead.

    Simon


  • NXSL Script - Get DCI Comments?
    D DrCamel
    Support

    Is there a way to retrieve the "Comments" property of a DCIObject?

    Essentially I'd like to add some support information to the comments section of a DCI, that is also then included in emails that are generated for alerts against that DCI.

    As a test I tried the following:-

    sub main() {
    	node = FindObject("SomeNode");
    	dciID = FindDCIByName(node, "SomeDCIName");
    	dciObj = GetDCIObject(node, dciID);
    	println(dciObj->name);
    	println(dciObj->comments);
    }
    

    However it errors on the comments attribute line, and certainly the https://wiki.netxms.org/wiki/NXSL:DCI page does not list a "comments" attribute (but there is one on the node object https://wiki.netxms.org/wiki/NXSL:Node)

    I've had a look through the script reference pages, but I can't see any functions to enable me to query it - does anyone know of a way to do so?

    Otherwise I guess I would need to use a custom attribute.

    Simon


  • Scripting problem with global variables in version 2.0-M2
    D DrCamel
    Support

    Ahh, yes, I see what you mean - I have modified my code based on your feedback and it is working correctly now.

    Thank you very much for your help!

    Simon


  • Scripting problem with global variables in version 2.0-M2
    D DrCamel
    Support

    First, I just want to say what an excellent product NetXMS is, thanks to everyone involved in making it what it is today.

    Now on to the issue I am experiencing, I am having a problem with scripting in that global variables do not appear to be working correctly (or I am misunderstanding how to use them, which is possibly more likely).

    I am defining a global variable in the following way:-

    global GlobalStringConstant = "String Value";
    

    However when I try to reference the global variable in functions, all I get is a NULL object.

    To test this I created a script in the script library called "TestScript" with the following code:-

    global GlobalStringConstant = "String Value";
    
    sub main() {
    	typeofValue = typeof(GlobalStringConstant);
    	println "Type:-";
    	println typeofValue;
    
    	println "Value:-";
    	println GlobalStringConstant;
    }
    

    Then in the server console, when I issue the command "exec TestScript", I get the following output:-

    Type:-
    null
    Value:-
    
    
    INFO: Script finished with rc=0
    

    Where I was expecting the output:-

    Type:-
    string
    String Value
    INFO: Script finished with rc=0
    

    I am running the current development version 2.0-M2 with the 64bit binaries running on a Windows Server 2008 R2 virtual machine which is connected to a Microsoft SQL Server 2008 R2 backend database.

    Any assistance anyone can offer would be very much appreciated.

    Thanks!

    Simon

  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups