Solved

Help with wmi via Nagios

Posted on 2013-06-24
2
578 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
  • 2
2 Comments
 
LVL 34

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 34

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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Rate limit for DNS queries 7 83
awk file 6 78
error while installing php56 in redhat enterprise linux 20 50
list of sudo access for date range 5 29
Learn how ViaSat reduced average response times for IT incidents from 10 minutes to 30 seconds.
Are client relationship the only driver of a successful MSP? While important, client relationships are only one component. Learn how else MSPs can broaden their horizon and differentiate themselves.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
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…

856 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