Welcome, Guest. Please login or register.
Did you miss your activation email?
06 Oct 2008, 10:35

Login with username, password and session length
Home Chat Help Search Calendar Login Register
Pages: [1] 2
Print
Author Topic: A Support Tool  (Read 4511 times)
0 Members and 1 Guest are viewing this topic.
Nullig
Power Poster
***

Karma: 55
Offline Offline

Posts: 1565

Location: White Rock, BC



« on: 12 Jun 2008, 20:24 »

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:
global $gCms;
$db = &$gCms->db;
$config = &$gCms->config;

echo "<b>CMS Made Simple Version:</b> " . $GLOBALS['CMS_VERSION'] . "<br />&nbsp;<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 />&nbsp;<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 />&nbsp;<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 />&nbsp;<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 Edit: 16 Jun 2008, 10:42 by Nullig » Logged

Come play in the Sandbox at my CMS Made Simple demo site: http://www.cmsmsdemo.com.
calguy1000
CMS GURU - 2nd Tier Support.
Dev Team Member
Power Poster
*****

Karma: 141
Offline Offline

Posts: 3942

Location: Calgary, Canada


Second Tier Support


WWW
« Reply #1 on: 12 Jun 2008, 20:30 »

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.
Logged

mark
Available for Consults
Support Guru
Power Poster
****

Karma: 125
Offline Offline

Posts: 5758

Location: Arizona


Keepin an eye out for you...


WWW
« Reply #2 on: 12 Jun 2008, 20:35 »

Very nice...

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

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

Go to Extensions Modules/Tags click the name of the module/tag or the word Help to the right to get the parameters it takes...
Not sure what ver. CMSMS, PHP, server OS, etc. try the Support Tool in your page...
CMSMS hosting available now, with installation, let me know if your interested...

WHY oh why, can anyone tell me, does it seem like no one reads all the pages that come with a default install.

OK if you removed the default content read it here... http://multiintech.com/default/
Nullig
Power Poster
***

Karma: 55
Offline Offline

Posts: 1565

Location: White Rock, BC



« Reply #3 on: 12 Jun 2008, 21:03 »

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

So on your test page you have:

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

Nullig
Logged

Come play in the Sandbox at my CMS Made Simple demo site: http://www.cmsmsdemo.com.
nuno
Forum Member
*

Karma: 1
Offline Offline

Posts: 204

Location: Portugal



« Reply #4 on: 12 Jun 2008, 21:17 »

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 Wink
echo "CMS version: " . $GLOBALS['CMS_VERSION'] . "<br />";
Logged

Humility and Availability make the Professional!
Dev-team Member
(thanks Ted and Calguy1000 for this opportunity)
mark
Available for Consults
Support Guru
Power Poster
****

Karma: 125
Offline Offline

Posts: 5758

Location: Arizona


Keepin an eye out for you...


WWW
« Reply #5 on: 12 Jun 2008, 22:37 »

Very nice indeed...

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

=

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 Edit: 12 Jun 2008, 22:55 by mark » Logged

Go to Extensions Modules/Tags click the name of the module/tag or the word Help to the right to get the parameters it takes...
Not sure what ver. CMSMS, PHP, server OS, etc. try the Support Tool in your page...
CMSMS hosting available now, with installation, let me know if your interested...

WHY oh why, can anyone tell me, does it seem like no one reads all the pages that come with a default install.

OK if you removed the default content read it here... http://multiintech.com/default/
cyberman
Support Team
Dev Team Member
Power Poster
*****

Karma: 141
Offline Offline

Posts: 6800

Location: Dohna / Saxony / Germany


Reality.sys is corrupt. Reboot universe (Y/N)?


WWW
« Reply #6 on: 13 Jun 2008, 01:05 »

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 Smiley.
Logged

Fr deutschsprachige Anwender / for german speaking users only
http://www.cmsmadesimple.de/ - die deutschsprachige Seite fr CMSms
http://demo.cmsmadesimple.de/ - die Informationen der CMSms-Musterinstallation in deutsch
http://wiki.cmsmadesimple.org/index.php/Main_Page/de - deutschsprachiges CMSms-Wiki
http://dev.cmsmadesimple.org/projects/german/ - deutsche Sprachdateien fr CMSms
Pierre M.
Support Team member
Support Guru
Power Poster
****

Karma: 31
Offline Offline

Posts: 2870

Location: Paris

Please keep it simple


« Reply #7 on: 13 Jun 2008, 11:40 »

Support tool ? +1 http://forum.cmsmadesimple.org/index.php/topic,11407.0.html
Pierre
Logged

-- Pierre, support team member. comodrateur du forum francophone.
Please read "how to submit installation/debug help requests" before posting. Don't send private messages to ask for support.
Want to contribute to CMSms ? Improve the wiki with your forum account.
Nullig
Power Poster
***

Karma: 55
Offline Offline

Posts: 1565

Location: White Rock, BC



« Reply #8 on: 13 Jun 2008, 15:14 »

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

Come play in the Sandbox at my CMS Made Simple demo site: http://www.cmsmsdemo.com.
alby
Member Support Team
Support Guru
Power Poster
****

Karma: 114
Online Online

Posts: 3039

Location: Ferrara, Italy


My kids


« Reply #9 on: 13 Jun 2008, 16:25 »

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

Very nice idea.
Can you add this:
Quote
echo "<li>Maximum Execution Time: " . get_cfg_var('max_execution_time') . "</li>";
echo "<li>Session Save Path: " . session_save_path() . "</li>";

echo "<li>SAPI: " . PHP_SAPI . "</li>";
echo "<li>OS: " . PHP_OS . "</li>";

Alby
Logged

Member CMSMS Support Team
Italian Forum Moderator - Italian admin Project

Plugins: Geolocate hostip - Multiple random image - Image rotator (test beta) - Content Pagination

Modules: ForumMadeSimple (Howto FMS)

Multilingual: CMSMS MLE 1.4.1 (Doc/Howto/Tips)
Nullig
Power Poster
***

Karma: 55
Offline Offline

Posts: 1565

Location: White Rock, BC



« Reply #10 on: 13 Jun 2008, 16:38 »

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

Come play in the Sandbox at my CMS Made Simple demo site: http://www.cmsmsdemo.com.
nuno
Forum Member
*

Karma: 1
Offline Offline

Posts: 204

Location: Portugal



« Reply #11 on: 13 Jun 2008, 17:15 »

Quote
I hope can be incorporated into the CMSMS Admin Panel.

I hope to, is nice TOOL/UDT vs Support Smiley

Best regards
Logged

Humility and Availability make the Professional!
Dev-team Member
(thanks Ted and Calguy1000 for this opportunity)
calguy1000
CMS GURU - 2nd Tier Support.
Dev Team Member
Power Poster
*****

Karma: 141
Offline Offline

Posts: 3942

Location: Calgary, Canada


Second Tier Support


WWW
« Reply #12 on: 13 Jun 2008, 19:27 »

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.
Logged

kermit
Power Poster
***

Karma: 32
Offline Offline

Posts: 654


Hug a Penguin today!


« Reply #13 on: 13 Jun 2008, 21:37 »

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.
Logged

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
CMS GURU - 2nd Tier Support.
Dev Team Member
Power Poster
*****

Karma: 141
Offline Offline

Posts: 3942

Location: Calgary, Canada


Second Tier Support


WWW
« Reply #14 on: 13 Jun 2008, 22:55 »

kermit, I like your way of thinking Smiley
Logged

Pages: [1] 2
Print
Jump to: