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

  1. Home
  2. Support
  3. Maintenance column in db after upgrade

Maintenance column in db after upgrade

Scheduled Pinned Locked Moved Support
3 Posts 3 Posters 13.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A
    A
    AP_ops
    wrote on last edited by
    #1

    Hello,

    Last week i did an upgrade to version 2.2.10

    We used to had a daily report through a db query that we check for systems that are in maintenance mode.

    the query is this one:

    USE netxms_db
    
    DECLARE @OBJECT_ID INT, @NAME VARCHAR(63), @ITEM_ID INT, @DESCRIPTION VARCHAR(255)
    SET @OBJECT_ID = 0
    SET @ITEM_ID = 0
    
    DECLARE @UNMANAGED_SYSTEMS TABLE(
        System VARCHAR(63)
    )
    
    WHILE (1 = 1)
    BEGIN
    
        SELECT TOP 1 @OBJECT_ID = object_id
        ,@NAME = name
        FROM netXMS.object_properties
        WHERE object_id > @OBJECT_ID AND maint_mode=1
        ORDER BY object_id
    
    	/* Exit loop if no more entries */
    	IF @@ROWCOUNT = 0 BREAK;
    
    	INSERT INTO @UNMANAGED_SYSTEMS SELECT @NAME AS System FROM [netxms_db].[netxms].[items] WHERE node_id = @OBJECT_ID
    
    END
    
    SELECT * FROM @UNMANAGED_SYSTEMS GROUP BY System ORDER BY System ASC
    

    After the upgrade the query is not working. I see some changes in the names but i cannot find a value for the maint_mode.
    Have you move it to different table?

    thanks

    1 Reply Last reply
    0
    • G
      G
      gdodd
      wrote on last edited by
      #2

      Seems if maint_event_id is greater than 0 the object is in maintenance mode. Looks like they are keeping track of more than a "yes/no" as just entering maintenance mode gives a value of 6335951 and if the object is scheduled for maintenance the value is 6335955.

      1 Reply Last reply
      0
      • A
        A
        Alex Kirhenshtein
        wrote on last edited by
        #3

        When node goes into maintenance mode, event MAINTENANCE_MODE_ENTERED is generated. Unique ID of the resulting event is saved into maint_event_id.

        1 Reply Last reply
        0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • 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