Troubleshooting/Debugging CMD.PHP

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
gilson
Posts: 27
Joined: Wed Jan 23, 2002 7:00 pm
Contact:

Troubleshooting/Debugging CMD.PHP

Post by gilson »

I need to correct the problems about some pollings.
The email from crond tipical is:
--------------------------------------------------------------
ERROR: expected 1 data source readings (got 0) from KBytes:...
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: host.hrDevice.hrProcessorTable.hrProcessorEntry.hrProcessorLoad.1

ERROR: expected 1 data source readings (got 0) from Bytes:...
ERROR: expected 1 data source readings (got 0) from Bytes:...
sh: /usr/local/bin/check_nt: Permission denied
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: enterprises.311.1.1.3.1.1.4.2.0

ERROR: expected 1 data source readings (got 0) from Bytes:...
ERROR: expected 1 data source readings (got 0) from KBytes:...
ERROR: unknown DS name 'spectrum_partc_uni'
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: host.hrDevice.hrProcessorTable.hrProcessorEntry.hrProcessorLoad.1

Timeout: No Response from 10.0.1.207.
X-Powered-By: PHP/4.0.6
Content-type: text/html
--------------------------------------------------------------
Before 0.6.7 I was using CRON PRINTOUT to discover which DataSource generated the error.
But now, I need a way to toubleshoot via CMD.PHP, which pooling is responsible for each error.

Could anybody give me some tips how to change cmd.php to log the current DS (or command line) in the output ?

I tried to 'print' some vars inside cmd.php but no sucess. All my messages went after "Content-type: text/html". I know almost nothing about php.

-Thanks
-Gilson
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

If you break down some of these errrors does not look too difficult to fix.

For instance, the OID:

Code: Select all

host.hrDevice.hrProcessorTable.hrProcessorEntry.hrProcessorLoad.1
Does not work for me. I am not sure what snmp implimentation/MIB you are querying this against, but it does not appear to work for ucd-snmp. For instance in ucd-snmp, these OID's may pertain you your cause:

Code: Select all

enterprises.ucdavis.systemStats.ssCpuUser.0
enterprises.ucdavis.systemStats.ssCpuSystem.0
enterprises.ucdavis.systemStats.ssCpuIdle.0
A little ways down, you are getting this error:

Code: Select all

sh: /usr/local/bin/check_nt: Permission denied 
As always... check your permissions. I think those two problems cover the errors you printed out. Tell me if you have any problems fixing these errors.

-Ian
gilson
Posts: 27
Joined: Wed Jan 23, 2002 7:00 pm
Contact:

Post by gilson »

Thanks Ian

But (for now :D ) I don't need support for those errors.
My setup consists in almost two hundreds poolings. I just need to identify which DS (in almost 200) is generating that error.

Docs (ITEM 8 ) ask to put a line in cron (*/5 * * * * cactiuser php /var/www/html/cacti/cmd.php > /dev/null 2>&1).
After having some poolings returning zero/none values, I decided to get rid " > /dev/null 2>&1" from cron line.

To help in troubleshooting, would be useful to have an output from cron like this:
-----------------------------------------------------------------
POOLING: www_snc_eth0_in:
ERROR: expected 1 data source readings (got 0) from KBytes:...
POOLING: www_snc_eth0_out:
POOLING: www_snc_cpu:
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: host.hrDevice.hrProcessorTable.hrProcessorEntry.hrProcessorLoad.1
POOLING: ftp_snc_xfr:
ERROR: expected 1 data source readings (got 0) from Bytes:...
POOLING: pop_snc_xfr:
ERROR: expected 1 data source readings (got 0) from KBytes:...
POOLING: iis_snc_mysql:
sh: /usr/local/bin/check_nt: Permission denied
POOLING: iis_snc_eth:
...
...
-----------------------------------------------------------------

After I have identified and corrected the errors, I can append back" > /dev/null 2>&1" to the cron line.

I think is a simple addition to cmd.php to print that debug line.

Hope this help to explain better my need.

Regards
-Gilson
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

I added this to my list of things to add to the next version. Adding more debug options is a very good idea, I will just have to decide what all options make sense. What you suggested is a good idea, and I will probably do something similar to this.

-Ian
gilson
Posts: 27
Joined: Wed Jan 23, 2002 7:00 pm
Contact:

Post by gilson »

I suppose several questions in this forum about things like this:
Cannot do this.., Cannot do that..., OID problem..., Problems gathering bla bla bla.., No data in graphs..., etc could be very easily identified with a troubleshoot like this.

On other hand, a lot of problems with graphing (data comes but graphics are blank..., NO Data in graphs, GPRINT does not work yet..., CDEFs not working..., etc) could be identified with a similar troubleshoot in graph_view.php, redirecting stdout and stderr (from external commands like rrdtool, snmpget, scripts, etc) to a log file, based on a flag that can turned on/off.

I will wait anxiously.

Thanks for your time.

-Gilson
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests