Adding a new datastream to display more information on the

carbonjoker

New Member
Oct 3, 2014
20
0
1
Hello,
I have been looking for a way of displaying the core temperature of the cpu's on my proxmox machine over a length of time on the web interface.

I currently have been able to add a new graph on the node status page however i am unable to find out how to add a new data stream and how to populate it with information in order to show the cpu temperatures.

How would i go about creating a new data stream to be displayed in the graph tab i have made?

Also one other note how many data streams can i have displayed on one of the graphs at one time as i have only ever seen 2 on them.
 
Hello,I currently have been able to add a new graph on the node status page however i am unable to find out how to add a new data stream and how to populate it with information in order to show the cpu temperatures.How would i go about creating a new data stream to be displayed in the graph tab i have made?
The solution to getting sensors working is here: https://forum.proxmox.com/threads/1...temperature-monitoring?p=101532#post101532But what I want to know is how you add new graphs? I can't find any mention of it anywhere but your post!
 
Hello,I currently have been able to add a new graph on the node status page however i am unable to find out how to add a new data stream and how to populate it with information in order to show the cpu temperatures.How would i go about creating a new data stream to be displayed in the graph tab i have made?
The solution to getting sensors working is here: https://forum.proxmox.com/threads/1...ll-temperature-monitoring?p=101532#post101532But what I want to know is how you add new graphs? I can't find any mention of it anywhere but your post!
 
I have already installed LMSensors and i have that all set-up in the background but how would i display the settings on the graphs?
 
All the perl modules used for such display are in: /usr/share/perl5/PVE/

Where would you like to display the data. You can either execute a cron job to update an exported environment variable and display it on each pass or directly access the binary each time within the perl script used to display it.
 
I would like to show it on a nodes summary page, i have edited the js file in order to display a new graph on the summary page and i ahve named it CPU Temp however i am unsure how i would edit the perl modules in order to add the lmsensors data to it.
 
The perl modules in /usr/share/perl5/PVE and it's subfolders are used to generate the string data for the control panel to display it. The control panel web server files are at /usr/share/pve-manager/ext4 and it's sibling folders with the main working javascript file being /usr/share/pve-manager/ext4/pvemanagerlib.js which is a cocatenation of various javascript files in the github repo. The js file node/Summary.js is one such snippet that is conjoined in it. It is in this one's contents that you will find the various blocks that are displayed - Status View, RRD Graphs, etc. You can place your string extraction code in an appropriately named .pm file in the perl modules folder and then include it in the pvemanagerlib.js file listed above inside the code that emanated from node/Summary.js at the preferred point. There is a mobile variant of the conjoined js file as well - touch/pvemanager-mobile.js which has the equivalent code.

An example of code used to display the memory used graph in it is:
Code:
        {
            xtype: 'pveRRDView',
            title: gettext('Network traffic'),
            datasource: 'netin,netout',
            rrdurl: rrdurl
        }
The various Y-Axis parameters are netin and netout in the example above.

If you just want some text displayed, then tag it onto some existing page. Locate the following snippet in pvemanagerlib.js:
Code:
            text += pkg + ': ' + version + ' (running version: ' +
                rec.ManagerVersion + ')\n'; 
            } else {
            text += pkg + ': ' + version + '\n'; 
            }
        });

        view.update(Ext.htmlEncode(text));
        }
    });
    },

Just before the last view.update statement, add one line (the 50C can be a variable that gets the temperature from LMSensors) to be like:
Code:
        });
        text += 'Temp: 50C' + '\n';
        view.update(Ext.htmlEncode(text));
        }
    });
    },

Now after uploading the modified file above, logout of all instances of your browser and clear the browser cache and then login again.
On the Nodes => Summary page, click the Package Versions button and at the bottom, you will see the string for the Temperature introduced above.
 
Last edited:
i am still unsure how the .js gets the information from the perl scripts to be displayed onto the graphs...
 
The perl scripts can take the information from any text file. Just make sure you have a cronjob running to execute some bash script that populates a text file in high usage environments. Alternatively, it is better to have the perl script execute a bash file within it and acquire it's output directly into it's display variable for low usage environments that do not warrant polling. COntinuous logging of values to a database on cronjobs and extracting it into perl arrays inside the display script is useful for graphing. Just study the existing graphs - cpu usage comes from some bash command and then how that data gets added to a graphing data array.
 
Hello again, been busyt so i have not been able to do much on this.

right i have done a bit of looking around and have found that all the data streams are stored in an rrd database.

Im not quire sure how i would modify the existing db to add an extra datastream for the temperature or how i would update this new datastream.

Once i have gotten these updated i assume i can just create a new graph display on the summary page with the name of my datastream and it should display it for me.

is this the right way to go about this?
 
Does anyone know how the data gets in putted into the rrd database?

I have added a new data stream into the rrd database with a new data stream applied to it (padded all previous results with the new data field) however because of this new field there is no new data being added (I am assuming its due to what ever puts the data into the database is no longer lining up due to the new data stream)

i ahve lm-sensors working and a datastream in the rrd database i just need to know how to put the data into the rrd database / how proxmox achieves this :)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!