Statistics - Where stored?

Hey guys,

I am undertaking a project that involved the FreePBX Distro as my system of choice. I am basically creating an Android remote monitoring app for sys. admins. Hopefully it will be handy enough little app.

This app communicates with a server I create, that itself communicates with the FreePBX system and pulls data from it. (Stats, call records etc).

What I am looking to find out is where are all the statistics on the ‘System Status’ page stored? In the MySQL database? I have tried to search the Linux dirs with no success, all I found was log files in my quick look.

Also, I assume its possible to access all of the call records etc? Is there anything at this early stage I should know that is locked down and could not be accessed with ease?

If not already apparent, I am not a veteran software engineer, merely a computer science student. Therefore I apologize for any ignorance! :stuck_out_tongue:

Thank you! :slight_smile:

There are several different interfaces you need to be aware of. 1 - The Asterisk Manager Interface 2 - SNMP system stats

The front page is simple if you look at code. Just runs linux df, mem and Asterisk AMI commands, parses them for regular expressions and formats as HTML.

Thank you for that. The way I will have my setup is my Freepbx server, then a server connected to that over ethernet, where I have my server application running that has the main logic functions that takes the data from the pbx.

Where exactly are the call statistics and stuff like that stored? I have been searching the PBX but cannot find. Is there a MySql server running or something that store all these statistics?

You searched the server and could not find MySQL? That is somewhat surprising as if you simply type mysql from the command prompt you will be in the SQL shell.

If you type show databases; then press the enter key on your keyboard maybe you will have that facepalm moment.

Thank you for that. Well I think I have found the MYSQL database files under var/lib/mysql/ . All of the call and relevant data seems to be stored there in the files.

Is it possible to connect to access this database externally? Lets say my server program wants to access var/lib/mysql/asteriskcdrdb/cdr.MYD (I believe that would be the right file vs .frm or .MYI )to extrapolate data, can I just access the file or do I have to connect to the database remotely?

Excuse my ignorance, relatively new to MySQL and trying to access another servers tables :stuck_out_tongue:

Suggest you pickup a book on MySQL

1 - Can you just read the file - no
2 - Can you connect to the database remotely - yes

SQL Sequential Query Language is just that, a command language, the server parses the SQL commands and returns the result of the query, writes or updates records etc.

What is the the default address for connecting to the default MySQL database remotely? I have been searching and can not find it.

I don’t understand your question? Address of what? What type of address?

Well as in, when I set up a JDBC connection, what address is used to connect to the MYSQL database in FreePBX? Like what is the address of the database?

You mean IP address?

The IP of the server of course? Holy guacamole, what other address would you use?

Oops sorry. I got the connection no problem in the end. Now the world, or FreePBX, is my oyster! As I can access the MySQL database now, that is most of what I need!

Well…I think so anyway! Would there be anything that a phone monitoring app would need from the FreePBX box that is not held in the many databases? Just incase I forget something big!


Nearly finished my app :slight_smile:

Could you tell me what Linux commands exactly are involved in the ‘‘System Statistics’’…as you can see here on the right side

I know the df command is for the storage but dont know about the rest.

Where would I find the code for this page?

We are not going to tell you the “exact method” performance monitoring on Linux could fill a book.

The easiest way for you to access that data from another application is with the SNMP. You install a free too such a Paessler on your Win box for you Linux challenged or Nagios/Munin for the Linux types.

All the performance data you could ever want is available.

I mean, is there a way to find out how the PHP page does it? How it get CPU, Storage and Memory? Would it be in PHP code?

Have you looked at the code? /var/www/html/admin/modules/dashboard on your system, or

Barry - You can look at it, but I am not trying to be a pain. You really don’t want to do it the way the web page is getting it.

Why don’t you back up and tell us what you are tying to accomplish. I am assuming you just want to monitor the performance of the box. Maybe I am making wrong assumptions.

Are you really still running FreePBX 2.3.0beta? If you are I think you are unproductively putting your cart before your horse, to do what you are trying to do, don’t you think you should be using supported software?