Solved

Help with wmi via Nagios

Posted on 2013-06-24
2
580 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
Connect to CentOS (in a local VMWare VM) using Putty 7 137
expand ext4 on centos 6 5 52
Check for Linux process in script 7 65
Remote login in windows 7 8 28
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Why pager replacement is still an issue OnPage has what some might call a “hate/hate” relationship with pagers. Not much room for love. As we see it, pagers are an antiquated bit of technology. Pagers are dinosaurs which, like most dinosaurs, sho…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

685 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