Make graph from data of a file containing some metric values
Moderators: Developers, Moderators
- william925
- Posts: 5
- Joined: Mon Jan 03, 2011 5:49 am
- Location: Nantes (France)
Make graph from data of a file containing some metric values
Hi everybody, I wish you a happy new year
I plan to make graphs, with a refresh every minute, of the different queries (SELECT, UPDATE, INSERT INTO ...) performed on the tables of a database from a file, automatically generated by a script that runs in the background.
Listing generated file containing the values of the metrics database:
www!27828777!44602272!22954!7626034!108094106!1099764!1184207!3040046!12730913!0!14236734!5767!147605000!25!1136533792!174996603!44602428!7626034!91!7565778 etc. ...
This file is generated every minute by a script running in the background (for Oracle databases and progress databases)
I need your help, I spent time searching already but I found nothing, or I did not understand
Thank you in advance.
I use:
CentOS Linux 5.5 (On VMWare Server 1.0.3)
Cacti 0.8.7g
Net-SNMP 5.x
RRDTool 1.4.x
I already have graphs of the bandwidth of my network interface (SNMP - Interface Statistics) with a refresh than a minute. (File .conf changed: * / 1 * * * *............).
(sorry for my English, I am a french user of cacti)
__________________________________________________________________________________________
(En version française)
Bonjour à tous et bonne année
J'envisage de mettre en place une solution qui permettrai de «grapher» minute par minute les différentes requêtes (SELECT, UPDATE, INSERT INTO...) effectuées sur les tables d'une base de données, à partir d'un fichier généré automatiquement par un script qui s'exécute en tache de fond.
Exemple de fichier généré contenant les valeurs des métriques de la base de données :
www!27828777!44602272!22954!7626034!108094106!1099764!1184207!3040046!12730913!0!14236734!5767!147605000!25!1136533792!174996603!44602428!7626034!91!7565778 etc...
Ce fichier est généré toutes les minutes par un script tournant en arrière plan (pour les bases oracle et progress)
J'ai besoin de votre aide, j'ai passé du temps à chercher déjà mais en vain
Merci d'avance
J'utilise :
Linux CentOS 5.5 (En machine virtuelle VMWare Server 1.0.3)
Cacti 0.8.7g
Net-SNMP 5.x
RRDTool 1.4.x
J'ai déjà des graphes de la bande passante de mon interface réseau (SNMP - Interface Statistics ) avec un rafraichissement d'une minute.
(fichier .conf modifié : */1 * * * *............).
I plan to make graphs, with a refresh every minute, of the different queries (SELECT, UPDATE, INSERT INTO ...) performed on the tables of a database from a file, automatically generated by a script that runs in the background.
Listing generated file containing the values of the metrics database:
www!27828777!44602272!22954!7626034!108094106!1099764!1184207!3040046!12730913!0!14236734!5767!147605000!25!1136533792!174996603!44602428!7626034!91!7565778 etc. ...
This file is generated every minute by a script running in the background (for Oracle databases and progress databases)
I need your help, I spent time searching already but I found nothing, or I did not understand
Thank you in advance.
I use:
CentOS Linux 5.5 (On VMWare Server 1.0.3)
Cacti 0.8.7g
Net-SNMP 5.x
RRDTool 1.4.x
I already have graphs of the bandwidth of my network interface (SNMP - Interface Statistics) with a refresh than a minute. (File .conf changed: * / 1 * * * *............).
(sorry for my English, I am a french user of cacti)
__________________________________________________________________________________________
(En version française)
Bonjour à tous et bonne année
J'envisage de mettre en place une solution qui permettrai de «grapher» minute par minute les différentes requêtes (SELECT, UPDATE, INSERT INTO...) effectuées sur les tables d'une base de données, à partir d'un fichier généré automatiquement par un script qui s'exécute en tache de fond.
Exemple de fichier généré contenant les valeurs des métriques de la base de données :
www!27828777!44602272!22954!7626034!108094106!1099764!1184207!3040046!12730913!0!14236734!5767!147605000!25!1136533792!174996603!44602428!7626034!91!7565778 etc...
Ce fichier est généré toutes les minutes par un script tournant en arrière plan (pour les bases oracle et progress)
J'ai besoin de votre aide, j'ai passé du temps à chercher déjà mais en vain
Merci d'avance
J'utilise :
Linux CentOS 5.5 (En machine virtuelle VMWare Server 1.0.3)
Cacti 0.8.7g
Net-SNMP 5.x
RRDTool 1.4.x
J'ai déjà des graphes de la bande passante de mon interface réseau (SNMP - Interface Statistics ) avec un rafraichissement d'une minute.
(fichier .conf modifié : */1 * * * *............).
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: Make graph from data of a file containing some metric va
This is explained at 1st link of my sig. The keyword to search is "Data Input Method". This allows you to create scripts that spit out any numbers you like. In your case, the script will query your database. Cacti will now in turn call your script to fetch the data out of your database
R.
R.
- william925
- Posts: 5
- Joined: Mon Jan 03, 2011 5:49 am
- Location: Nantes (France)
Re: Make graph from data of a file containing some metric va
Ah... thank you very much dude
GOD BLESS YOU "GANDALF"
GOD BLESS YOU "GANDALF"
- william925
- Posts: 5
- Joined: Mon Jan 03, 2011 5:49 am
- Location: Nantes (France)
Re: Make graph from data of a file containing some metric va
Hi everyone !
I've successfully created graph with "DATA QUERY" (Get SNMP Data (Indexed)).
I created the .xml file... and I used the OID .1.3.6.1.4.1.2021.8
I follow this tutorial : "SNMP Data Query Walkthrough"
I have 1 graph with 1 value.
But in my project I have 21 values to graph.
So, I looked at this topic "[HOWTO] Install and configure the Net-SNMP agent for Unix"
And I saw this :
_______________________________________________________________________
Now let's run this second script, which returns more than one result :
It returns two values, one per line (this is important).
Another way to call scripts from snmpd.conf is by specifying an OID, like this :
Run this query :
First line returned by the script will be available at .1.3.6.1.4.1.2021.555.101.1, second one at .1.3.6.1.4.1.2021.555.101.2, and so on.
_______________________________________________________________________
But I don't understand..
For 1 value, when I executed "snmptable" with the OID .1.3.6.1.4.1.2021.8, I have extIndex, extOutput, extResult, etc... and I can use these on cacti.
(exec shelltest /bin/sh /tmp/my_script.sh)
But for 21 values, when I executed "snmptable" with the OID .1.3.6.1.4.1.2021.555, I received the message "Was that a table?" Nothing usable on cacti..
But the "snmpwalk" works very well and my 21 values were displayed..
(exec .1.3.6.1.4.1.2021.555 /bin/sh /tmp/my_script.sh)
Please help me.
Thanks in advance
I've successfully created graph with "DATA QUERY" (Get SNMP Data (Indexed)).
I created the .xml file... and I used the OID .1.3.6.1.4.1.2021.8
I follow this tutorial : "SNMP Data Query Walkthrough"
I have 1 graph with 1 value.
But in my project I have 21 values to graph.
So, I looked at this topic "[HOWTO] Install and configure the Net-SNMP agent for Unix"
And I saw this :
_______________________________________________________________________
Now let's run this second script, which returns more than one result :
Code: Select all
$ /tmp/bar.sh
456
789
Another way to call scripts from snmpd.conf is by specifying an OID, like this :
Code: Select all
exec .1.3.6.1.4.1.2021.555 /bin/sh /tmp/bar.sh
Code: Select all
$ snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.555
UCD-SNMP-MIB::ucdavis.555.1.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.555.2.1 = STRING: "/bin/sh"
UCD-SNMP-MIB::ucdavis.555.3.1 = STRING: "/tmp/bar.sh"
UCD-SNMP-MIB::ucdavis.555.100.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.555.101.1 = STRING: "456"
UCD-SNMP-MIB::ucdavis.555.101.2 = STRING: "789"
UCD-SNMP-MIB::ucdavis.555.102.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.555.103.1 = ""
_______________________________________________________________________
But I don't understand..
For 1 value, when I executed "snmptable" with the OID .1.3.6.1.4.1.2021.8, I have extIndex, extOutput, extResult, etc... and I can use these on cacti.
(exec shelltest /bin/sh /tmp/my_script.sh)
But for 21 values, when I executed "snmptable" with the OID .1.3.6.1.4.1.2021.555, I received the message "Was that a table?" Nothing usable on cacti..
But the "snmpwalk" works very well and my 21 values were displayed..
(exec .1.3.6.1.4.1.2021.555 /bin/sh /tmp/my_script.sh)
Please help me.
Thanks in advance
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: Make graph from data of a file containing some metric va
I do not understand your last move.
We were talking about Data Input Method. This will even work if the script spits out multiple values in a row. You won't need a data query for that.
R.
We were talking about Data Input Method. This will even work if the script spits out multiple values in a row. You won't need a data query for that.
R.
- william925
- Posts: 5
- Joined: Mon Jan 03, 2011 5:49 am
- Location: Nantes (France)
Re: Make graph from data of a file containing some metric va
Hi.
Yes Gandalf, it works perfectly with Data Input Method.
All values are "graphed".
I abandoned the Data Query.
Now I have my graphs, but there is a problem in my opinion..
I link two pictures, the first is my original graph, and the second my original graph with lines on integer.
I wish I had to have graphs with only integers because the scripts returns integer only...
How Cacti can "graph" decimals, whereas the script returns only integers ??
Thx in advance
Yes Gandalf, it works perfectly with Data Input Method.
All values are "graphed".
I abandoned the Data Query.
Now I have my graphs, but there is a problem in my opinion..
I link two pictures, the first is my original graph, and the second my original graph with lines on integer.
I wish I had to have graphs with only integers because the scripts returns integer only...
How Cacti can "graph" decimals, whereas the script returns only integers ??
Thx in advance
- Attachments
-
- Original graph.JPG (50.99 KiB) Viewed 779 times
-
- Graph.JPG (56.05 KiB) Viewed 779 times
Last edited by william925 on Mon Feb 07, 2011 11:17 am, edited 3 times in total.
- william925
- Posts: 5
- Joined: Mon Jan 03, 2011 5:49 am
- Location: Nantes (France)
Re: Make graph from data of a file containing some metric va
An other problem...
I link a third graph..
"milli-values" were "graphed"
I think... Cacti is supposed to "graph" 0 not 0.010 or 0.050 etc...
I link a third graph..
"milli-values" were "graphed"
I think... Cacti is supposed to "graph" 0 not 0.010 or 0.050 etc...
- Attachments
-
- Graph2.JPG (50.01 KiB) Viewed 778 times
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: Make graph from data of a file containing some metric va
This is default rrdtool consolidation. Have a read at the rrdtool site, http://www.vandenbogaerdt.nl and/or 1st link of my sig (rrdtool chapter)
R.
R.
Who is online
Users browsing this forum: No registered users and 0 guests