SolarWinds THWACK
THWACK
  • Sign In
  • Search
  • Product Forums
    • Observability
      • SolarWinds Observability
      • Hybrid Cloud Observability
      • DevOps
    • The Orion Platform
      • Forum
      • Scalability Engines (HA, APE, AWS)
      • Enterprise Operations Console (EOC)
      • Orion SDK
      • Alert Lab
      • Report Lab
    • Network Management
      • Network Performance Monitor (NPM)
      • NetFlow Traffic Analyzer (NTA)
      • Network Configuration Manager (NCM)
      • IP Address Manager (IPAM)
      • User Device Tracker (UDT)
      • VoIP & Network Quality Manager (VNQM)
      • Log Analyzer
      • Engineer’s Toolset
      • Network Topology Mapper (NTM)
      • Kiwi CatTools
      • Kiwi Syslog Server
      • ipMonitor
    • Systems Management
      • Server & Application Monitor (SAM)
      • Virtualization Manager (VMAN)
      • Storage Resource Monitor (SRM)
      • Server Configuration Monitor (SCM)
      • SolarWinds Backup
      • Web Performance Monitor (WPM)
    • Database Management
      • Database Performance Analyzer (DPA)
      • SQL Sentry
      • Database Performance Monitor (DPM)
      • Database Mapper
      • Task Factory
    • Application Management
      • AppOptics
      • Loggly
      • Papertrail
      • Pingdom
      • DevOps
    • IT Security
      • Access Rights Manager (ARM)
      • Identity Monitor
      • Security Event Manager (SEM)
      • Patch Manager
      • Serv-U FTP & MFT
    • IT Service Management
      • SolarWinds Service Desk (SWSD)
      • Web Help Desk (WHD)
      • DameWare Remote Support (DRS)
      • DameWare Remote Everywhere (DRE)
      • DameWare Mini Remote Control (MRC)
  • Resources
    • THWACK Command Center
    • DevOps
    • What We're Working On
    • Blogs
      • Community Announcements
      • Product Blog
      • Monitoring Central
      • Geek Speak
      • The DevOps Blog
    • THWACK Tech Tips
    • TechPod
    • Support
      • Success Center
      • Documentation
      • Submit a Support Ticket
      • Customer Portal
      • Renew Maintenance
    • Community Groups
      • New To THWACK
      • Federal & Government
      • User Experience
      • EMEA Group
      • Japan Group
  • Events, Missions, & Musings
    • Events
      • THWACK Livecast
      • THWACK Livecast Archive
      • SolarWinds Lab
      • SolarWinds Lab Archive
      • THWACKcamp 2022 On Demand
      • SolarWinds User Groups
      • SolarWinds Events Calendar
    • Missions & Contests
      • Monthly Mission: What Killed Your Productivity?
      • THWACK 101
    • Musings
      • Water Cooler
      • Geek Tank
      • IT Tech Jobs/Careers
      • Monitoring for Managers
    •  
      •  
  • Content Exchange
    • The Orion Platform
      • Alerts
      • Custom HTML
      • Custom Queries
      • Modern Dashboards
      • Reports
      • Scripts
    • Network Performance Monitor
      • Device Pollers
      • Universal Device Pollers (UnDP)
    • Network Configuration Manager
      • Config Change Scripts
      • Device Templates
      • Firmware Upgrade Templates
      • Policy Documents
    • Server & Application Monitor
      • API Pollers
      • Application Monitor Templates
    • Server Configuration Monitor
      • Policies
      • Profiles
    • Database Performance Analyzer
      • Custom Alerts
      • Custom Metrics
      • Custom Queries
    • Web Help Desk
      • Style Sheets
  • Academy
    • Newsroom
    • Forums
      • Classroom Discussions
      • SolarWinds Certified Professional (SCP)
    • Training & Certification
  • Free Tools & Trials
  • Store
The Orion Platform
  • Content Exchange
  • More
The Orion Platform
Custom Queries NCM Backup Job Config Status
  • Tags
  • More
  • Cancel
Options
  • View all
  • Previous
  • Next
  • View slideshow
  • More
  • Cancel
fileName

NCM Backup Job Config Status

This query is an attempt to pull together as much information within NCM as far as its backup jobs go, NCM login status and the age of the last backup. It's not perfect and relies on a few not so ideal ways to join various bits of data but it's sufficient. Long story short, SolarWinds NCM could do a better job at auditing its own happenings.

Regardless, here's what the query shows and also a mockup of what it looks like if you use within a modern dashboard.

  • Last Login status, "Login OK" = 1 (Status of UP, else 3 / Warning)
  • Last Backup, "Successful" = 1 (Status of UP, else 3 / Warning)
    • Pulls data from the NCM Job Audit logs based off IP Address match join
  • Backup Age < 48 hrs = 1 (Status of UP, else 3 / Warning)
    • Checks the attempted download time of the last backup
  • Link to most recent config and its ConfigID

The query:

SELECT
     n.Caption
    ,n.IP_Address
	,n.Status
    ,n.DetailsUrl
    ,nc.NodeID
    ,CASE WHEN nc.LoginStatus = 'Login OK' THEN 1
        ELSE 3
     END AS [Last Login]
    ,CASE WHEN j.Result = 'Successful' THEN 1
        ELSE 3
     END AS [Last Backup]
    ,CASE WHEN HOURDIFF(TOLOCAL(a.AttemptedDownloadTime), GETDATE()) < 48 THEN 1
        ELSE 3
     END AS [Backup Age]
    ,a.AttemptedDownloadTime
    ,CASE WHEN a.ConfigID IS NOT NULL THEN CONCAT('/Orion/NCM/ConfigDetails.aspx?configID={', a.ConfigID, '}')
          ELSE NULL
     END AS [Most Recent Config]
    ,'Config' AS [Config]
FROM NCM.Nodes AS nc
INNER JOIN Orion.Nodes AS n ON n.NodeID = nc.CoreNodeID
LEFT JOIN ( SELECT
     ca.Username AS [JobName]
    ,ca.ModuleName AS [Function]
    ,ca.Action
    ,ca.Type AS [Result]
    ,ca.Details AS [ResultDetails]
    ,CASE WHEN ca.Type = 'Successful' AND ca.Details LIKE 'Config downloaded from %' THEN REPLACE(ca.Details, 'Config downloaded from ', '')
          WHEN ca.Type = 'Failed' AND ca.Details LIKE 'Connection Refused by %' THEN REPLACE(ca.Details, 'Connection Refused by ', '')
          ELSE NULL
     END AS [IPAttempt]
    ,MAX(ca.DateTime) AS [DateTime]
FROM Cirrus.Audit AS ca
WHERE ca.ModuleName = 'JobsAudit'
AND HOURDIFF(TOLOCAL(ca.DateTime), GETDATE()) < 48
GROUP BY ca.Username
    ,ca.ModuleName
    ,ca.Action
    ,ca.Type
    ,ca.Details ) AS j ON j.IPAttempt = n.IP_Address
LEFT JOIN ( SELECT
     nc.NodeID
    ,ca2.ConfigID
    ,ca2.AttemptedDownloadTime
FROM NCM.Nodes AS nc
INNER JOIN ( SELECT
     c.NodeID
    ,MAX(c.AttemptedDownloadTime) AS [AttemptedDownloadTime]
FROM NCM.ConfigArchive AS c
GROUP BY c.NodeID ) AS ca1 ON ca1.NodeID = nc.NodeID
LEFT JOIN NCM.ConfigArchive AS ca2 ON ca2.NodeID = nc.NodeID AND ca2.AttemptedDownloadTime = ca1.AttemptedDownloadTime ) AS a ON a.NodeID = nc.NodeID

  • backup
  • ncm jobs
  • ncm
  • jobs
sum_giais
sum_giais
  • 1 Sep 2022
  • 22 Downloads
  • Share
  • More
  • Cancel
Anonymous
  • sum_giais
    sum_giais 8 months ago in reply to stuartd

    The query and the file are updated to include status as well now, thanks. For limiting it to only nodes that are up, you could append this at the very end of the query on a new line.

    WHERE n.Status = 1

    • Cancel
    • Up 0 Down
    • Reply
    • More
    • Cancel
  • stuartd
    stuartd 8 months ago in reply to stuartd

    Maybe also a state of unmanaged would be useful as well.

    Alternatively, have the widget only display results for nodes that are UP.

    • Cancel
    • Up 0 Down
    • Reply
    • More
    • Cancel
  • stuartd
    stuartd 8 months ago

    Love this - thank you.

    Any chance you can add in a way to show the status of the node (up or down would be enough)? That way we can see at a glance that the device is down so no point trying to action anything.

    • Cancel
    • Up 0 Down
    • Reply
    • More
    • Cancel

SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 190,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process.

SolarWinds Customer Success Center Certification SolarWinds Lab Link Accounts
About THWACK Blogs Federal & Government Edit Settings Free Tools & Trials
Legal Documents Terms of Use Privacy California Privacy Rights Security Information
©2021 SolarWinds Worldwide, LLC. All Rights Reserved.