Solved

Help with wmi via Nagios

Posted on 2013-06-24
2
583 Views
Last Modified: 2013-06-25
I run the following wmi query aginst NS client

nscp wmi --select "select Frequency_PerfTime from Win32_PerfRawData_CustomTiersCalculator_CustomTiersCalculator"

and the output looks like

| Frequency_PerfTime |
|--------------------|
| 2660000000         |


Is there a way so I can make it so the only output is 2660000000?
0
Comment
Question by:Alice7
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 35

Accepted Solution

by:
Duncan Roe earned 500 total points
ID: 39274290
Try this
nscp wmi --select "select Frequency_PerfTime from Win32_PerfRawData_CustomTiersCalculator_CustomTiersCalculator" | tail --lines=1 | awk '{print $2}'

Open in new window

0
 
LVL 35

Assisted Solution

by:Duncan Roe
Duncan Roe earned 500 total points
ID: 39274292
How it works: given the output
| Frequency_PerfTime |
|--------------------|
| 2660000000         |

Open in new window

discard all but the last line using tail --lines=1. Next use awk '{print $2}' to output only the 2nd non-space sequence in that line.
0

Featured Post

Ready to trade in that old firewall?

Whether you need to trade-up to a shiny new Firebox or just ready to upgrade from whatever appliance you're using now, WatchGuard has the right appliance for you! Find your perfect Firebox today with appliance sizing tool!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are IT support and need to work after hours to resolve customer issues then here are a few tips on how to handle after hours support
Popular third-party chat platforms like Slack, Discord, and Telegram are just a few of the many new productivity applications that are being hijacked by cybercriminals to create command-and-control (C&C) communications infrastructures for their malw…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
Suggested Courses

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question