Times between all the "get" query in data_query

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
Alialex
Posts: 2
Joined: Fri Jun 15, 2007 3:10 pm
Location: Lille - France

Times between all the "get" query in data_query

Post by Alialex »

Hy,
I try to do a script to monitor all the cpus on servers.

I've made a data queries which workd well (found all the cpus and get all the different % like user,system,nice,...) but there's something not normal :

- on mono-cpu, the cpu (the average off all the cpus) is not the same as cpu0 (the first and only one).
- the addition of all the numbers (system+nice+irq+idle+...) makes more than 100%.

I think the queries are made one after the other and the cpu is working, so the moment where I get the system value is not the same moment where I get the user value...

So I've made a Data input method, and every things is ok, but I have to tell the number of cpu and the name (index) for them.

How can I have both a way to get the number of cpu (like in data queries to get the index and to make a graph for each one) and to get in one script all the variable ( so that all the variables are get at the same times) ?

Sorry for my english, I do my best, for sure

Alex
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

First of all, net-snmp handling of CPUs has always been a mystery. E.g. a 4 way machine may add up to 400% of utilization. But behaviour has been changed with net-snmp 5.4. You may try that version prior to create workarounds that will be obsoleted by the new version.
Reinhard
Alialex
Posts: 2
Joined: Fri Jun 15, 2007 3:10 pm
Location: Lille - France

Post by Alialex »

Many thanks for answer,

I don't use snmp for all the "mistery" in it, I try to understand how it works but I can't found all the things I need in it, maby I don't know all th OID I need.

I have the control of all the linux boxes, so I make a cacti user on them and get all the information by ssh (I use publickey).

I try both data queries and data input method and I need data queries to get the number of cpu and making all the graphs, but I prefer the way input method get all the information in one connection.

Something like a data queries that can do a :

"scripts name" get all

to get all the information in one connection will be great.

I think (but not sure) the data queries do :

"scripts name" get "variable" "index"

for all the index, and for all the variable by index, this makes many connection with times delay (in my case up to 35 connections : 7 variables by 5 index with 2 dual-core and the cpu wich is the average).

My question is : Did I miss somethings that can help me ?

thanks bis
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

There are several approaches to this. All, that I'm aware of are described at the first link of my signature:
- single SNMP get method
- data input method using a single or multiple output variables
- indexed SNMP Queries
- indexed Script Queries
All of them do have some advantages and some disadvantages. In general, SNMP is way faster than scripts. E.g. indexed Script Queries will be called quite often to fetch each output field.
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests