A Support Tool

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

A Support Tool

Post by Nullig »

Here is a small start to something I hope can be incorporated into the CMSMS Admin Panel. The idea is to provide a simple means to gather the basic info required for support questions in the Forum.

Create a UDT called "support_info" and add the following code:

Updated to include CMSMS Version and active modules
Updated 13/6/2008 to add more php config info, browser info and directory permission info
Updated 14/6/2008 mostly cosmetic changes and changed from get_cfg_var to ini_get
Updated 16/6/2008 to add mysqli and postgre db info

Code: Select all

global $gCms;
$db = &$gCms->db;
$config = &$gCms->config;

echo "<b>CMS Made Simple Version:</b> " . $GLOBALS['CMS_VERSION'] . "<br /> <br />";
echo "<b>Installed Modules:</b> ";
echo "<ul>";
$query = "SELECT * FROM ".cms_db_prefix()."modules WHERE active=1";
$dbresult = $db->Execute($query);
while($row = $dbresult->FetchRow()) {
	echo "<li>" . $row['module_name'] . ": " . $row['version'] . "</li>";
} 
echo "</ul>";

echo "<b>Current PHP Version:</b> " . phpversion() . "<br /> <br />";
echo "<b>PHP Configuration:</b>";
echo "<ul>";
echo "<li>Maximum Post Size: " . ini_get('post_max_size') . "</li>";
echo "<li>Maximum Upload Size: " . ini_get('upload_max_filesize') . "</li>";
echo "<li>PHP Memory Limit: " . ini_get( 'memory_limit' ) . "</li>";

if (ini_get('safe_mode') == 1) {
        echo "<li>PHP Safe Mode: On</li>";
} else {
        echo "<li>PHP Safe Mode: Off</li>";
}
echo "<li>Maximum Execution Time: " . ini_get('max_execution_time') . " seconds</li>";
echo "<li>Session Save Path: " . session_save_path() . "</li>";

echo "</ul>";

switch($config['dbms']) 
{
    case 'postgres7': 	$v = pg_version();
			$_server_db = "<b>PostgreSQL Server Version:</b> " . $v['server_version'];
                        break;
    case 'mysql':	$v = mysql_get_server_info();
			$_server_db = "<b>MySQL Server Version:</b> " . $v;
                        break;
    case 'mysqli':      $v = mysqli_get_server_info();
			$_server_db = "<b>MySQLi Server Version:</b> " . $v;
                        break;
}

echo $_server_db . "<br /> <br />";

echo "<b>Server Software:</b> " . $_SERVER['SERVER_SOFTWARE'] . "<br />";
echo "<b>Server API:</b> " . strtoupper(PHP_SAPI) . "<br />";
echo "<b>Server OS:</b> " . PHP_OS . " v " . php_uname('r') . " on " . php_uname('m') . " architecture<br /> <br />";

clearstatcache();

echo "<b>Directory Permissions:</b>";
echo "<ul>";
echo "<li>tmp/cache - " . substr(sprintf('%o', fileperms($config['root_path'].DIRECTORY_SEPARATOR.'tmp/cache')), -4) . "</li>";
echo "<li>tmp/templates_c - " . substr(sprintf('%o', fileperms($config['root_path'].DIRECTORY_SEPARATOR.'tmp/templates_c')), -4) . "</li>";
echo "<li>uploads - " . substr(sprintf('%o', fileperms($config['root_path'].DIRECTORY_SEPARATOR.'uploads')), -4) . "</li>";
echo "<li>modules - " . substr(sprintf('%o', fileperms($config['root_path'].DIRECTORY_SEPARATOR.'modules')), -4) . "</li>";
echo "</ul>";

echo "<b>Browser:</b> " . $_SERVER['HTTP_USER_AGENT'] . "<br />";
Now you can place the {support_info} tag on a test page and it will print out some of the basic configuration info that is required to provide effective support, which you can copy and paste into your Forum posting.

Perhaps others could add to the code, to make it more comprehensive. I'm thinking that we should be able to read the Apache and MySQL log files, to include a number of lines from them as well.

Nullig
Last edited by Nullig on Mon Jun 16, 2008 2:42 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: A Support Tool

Post by calguy1000 »

Not a bad plan...

We should also include
  a) current CMS version  (global $CMS_VERSION)
  b) which versions of which modules are installed
      (iterating through $gCms->modules)
  c) the host type if we can get it
  d) some basic permissions checks
  e) some basic functionality tests (like what the installer has).

And when this information is collected, maybe, just maybe a module or something could be written that would allow a user to type in his CMS forum username, password, and a description of the problem and have this stuff posted to the forum as a new post.

It'd definately help some people to provide some useful information.  They would still have to know what all that information means.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: A Support Tool

Post by Dr.CSS »

Very nice...

I put it in a template, wrong one so I didn't see it...

How to put in other parts I wonder?...
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Re: A Support Tool

Post by Nullig »

Forgot the MOST important piece of info... DUH!!!

So on your test page you have:

Code: Select all

CMS Made Simple Version: {cms_version}<br />
{support_info}
Nullig
nuno

Re: A Support Tool

Post by nuno »

mark wrote: Very nice...

I put it in a template, wrong one so I didn't see it...

How to put in other parts I wonder?...

or add in that UDT ;)
echo "CMS version: " . $GLOBALS['CMS_VERSION'] . "
";
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: A Support Tool

Post by Dr.CSS »

Very nice indeed...

echo "Current PHP Version: " . phpversion() . "
";
echo "Maximum Post Size: " . get_cfg_var('post_max_size') . "
";
echo "Maximum Upload Size: " . get_cfg_var('upload_max_filesize') . "
";
echo "PHP Memory Limit: " . get_cfg_var( 'memory_limit' ) . "
";
echo "MySQL Server Version: " . mysql_get_server_info() . "
 
";
echo "Server Software: " . $_SERVER['SERVER_SOFTWARE'] . "
";
echo "CMS version: " . $GLOBALS['CMS_VERSION'] . "
 
";

=

Current PHP Version: 5.2.6
Maximum Post Size: 8M
Maximum Upload Size: 10M
PHP Memory Limit: 40M
MySQL Server Version: 5.0.45-community

Server Software: Apache/1.3.41 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_ssl/2.8.31 OpenSSL/0.9.7a
CMS version: 1.3

Updated code now =...

CMS Made Simple Version: 1.3
Installed Modules:

    * CMSMailer vers - 1.73.13
    * FileManager vers - 0.3.0
    * MenuManager vers - 1.5
    * ModuleManager vers - 1.1.6
    * News vers - 2.8
    * nuSOAP vers - 1.0.1
    * Printing vers - 0.2.3
    * Search vers - 1.5
    * ThemeManager vers - 1.0.8
    * TinyMCE vers - 2.4.1
    * CGExtensions vers - 1.8
    * Blogs vers - 0.3.0b2
    * CompanyDirectory vers - 1.1.3

Current PHP version: 5.2.6
Maximum Post Size = 8M
Maximum Upload Size = 10M
PHP Memory Limit = 40M
MySQL server version = 5.0.45-community

Server Software = Apache/1.3.41 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_ssl/2.8.31 OpenSSL/0.9.7a
Last edited by Anonymous on Fri Jun 13, 2008 2:55 am, edited 1 time in total.
cyberman

Re: A Support Tool

Post by cyberman »

Nullig wrote: Here is a small start to something I hope can be incorporated into the CMSMS Admin Panel.
Yes - think a separate information page in admin panel would be a very good idea!

Users can access this page faster than an udt :).
Pierre M.

Re: A Support Tool

Post by Pierre M. »

User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Re: A Support Tool

Post by Nullig »

Updated the first post to add some more info...
alby

Re: A Support Tool

Post by alby »

Nullig wrote: Updated the first post to add some more info...
Very nice idea.
Can you add this:
echo "Maximum Execution Time: " . get_cfg_var('max_execution_time') . "";
echo "Session Save Path: " . session_save_path() . "";

echo "SAPI: " . PHP_SAPI . "";
echo "OS: " . PHP_OS . "";
Alby
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Re: A Support Tool

Post by Nullig »

Thanks, alby. I've incorporated your suggestions.
nuno

Re: A Support Tool

Post by nuno »

I hope can be incorporated into the CMSMS Admin Panel.
I hope to, is nice TOOL/UDT vs Support :)

Best regards
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: A Support Tool

Post by calguy1000 »

I'll tell ya what...

if somebody writes the code, and submits a patch against current svn, I'll review it, and work with you to include it in 1.4

it may be a way to get your feet wet in core coding.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
kermit
Power Poster
Power Poster
Posts: 693
Joined: Thu Jan 26, 2006 11:46 am

Re: A Support Tool

Post by kermit »

it could be incorporated into an "about cmsms" page in the back-end, perhaps under "main" or "site admin" -- with copyright info (including that for the various 3rd party code and libraries used), a list of the individuals who've contributed to the core code, links to the various parts of the cmsms.org site, the text of the gpl license (and others that may be used by portions of the code), and a little blurb about "how to submit a bug report and obtain support in the forums". it could even be rigged so that this page is shown the very first time the superadmin logs into the back-end after installation.
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: A Support Tool

Post by calguy1000 »

kermit, I like your way of thinking :)
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Locked

Return to “Tips and Tricks”