Problem graphing Unix CPU usage

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

elnino
Cacti User
Posts: 205
Joined: Tue Mar 08, 2005 9:51 pm

Problem graphing Unix CPU usage

Post by elnino »

I'm trying to graph the CPU usage of a remote Unix server. When I try to add the "SNMP - Interface Statistics" data query, it says Success [0 Items, 0 Rows]. The verbose query says
+ Running data query [9].
+ Found type = '4 '[script query].
+ Found data query XML file at '/usr/local/cacti/resource/script_queries/host_cpu.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /usr/local/cacti/scripts/query_host_cpu.php 192.0.0.236 public 1 index'
+ Executing script query '/usr/bin/php -q /usr/local/cacti/scripts/query_host_cpu.php 192.0.0.236 public 1 query index'
+ Found data query XML file at '/usr/local/cacti/resource/script_queries/host_cpu.xml'
+ Found data query XML file at '/usr/local/cacti/resource/script_queries/host_cpu.xml'
+ Found data query XML file at '/usr/local/cacti/resource/script_queries/host_cpu.xml'
But, when I run snmpwalk -v 1 -c public 192.0.0.236 .1.3.6.1.2.1.25.3.3.1 I get
HOST-RESOURCES-MIB::hrProcessorFrwID.0 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrProcessorFrwID.1 = OID: SNMPv2-SMI::zeroDotZero
HOST-RESOURCES-MIB::hrProcessorLoad.0 = INTEGER: 36
HOST-RESOURCES-MIB::hrProcessorLoad.1 = INTEGER: 35
I can even run snmpwalk -v 1 -c public 192.0.0.236 .1.3.6.1.2.1.25.3.3.1 -On and get
.1.3.6.1.2.1.25.3.3.1.1.0 = OID: .0.0
.1.3.6.1.2.1.25.3.3.1.1.1 = OID: .0.0
.1.3.6.1.2.1.25.3.3.1.2.0 = INTEGER: 36
.1.3.6.1.2.1.25.3.3.1.2.1 = INTEGER: 35
but it'll always return 0 Items and 0 Rows in Cacti. What am I doing wrong? I think I'm using snmp 5.0.9 and running Cacti 0.8.6c. Thanks!
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

What results do you get if you run:

Code: Select all

/usr/bin/php -q /usr/local/cacti/scripts/query_host_cpu.php 192.0.0.236 public 1 query index
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
elnino
Cacti User
Posts: 205
Joined: Tue Mar 08, 2005 9:51 pm

Post by elnino »

Here's what I get when I run it as root:

Code: Select all

PHP Warning:  main(../include/config.php): failed to open stream: No such file or directory in /usr/local/cacti/scripts/query_host_cpu.php on line 3
PHP Warning:  main(): Failed opening '../include/config.php' for inclusion (include_path='.:/usr/lib/php') in /usr/local/cacti/scripts/query_host_cpu.php on line 3
PHP Warning:  main(../include/snmp_functions.php): failed to open stream: No such file or directory in /usr/local/cacti/scripts/query_host_cpu.php on line 4
PHP Warning:  main(): Failed opening '../include/snmp_functions.php' for inclusion (include_path='.:/usr/lib/php') in /usr/local/cacti/scripts/query_host_cpu.php on line 4
Would I need to change something in the php.ini file?
elnino
Cacti User
Posts: 205
Joined: Tue Mar 08, 2005 9:51 pm

Post by elnino »

I looked at it more today and noticed that snmp_functions.php wasn't in my includes directory. I looked in my cacti_old directory (my backup directory before I upgraded) and I noticed there were more files in that directory than my current one. Should I copy those over too?

I re-ran /usr/bin/php -q /usr/local/cacti/scripts/query_host_cpu.php 192.0.0.236 public 1 query index as root and it didn't give any errors, but when I tried the SNMP - Get Processor Information for my Unix server, it's still saying 0 Items, 0 Rows. What else should I be looking for?
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Do not copy old file over to the new installation, I don't think it will make a difference.

I have much concern over the following error:

Code: Select all

PHP Warning:  main(../include/config.php): failed to open stream: No such file or directory in /usr/local/cacti/scripts/query_host_cpu.php
Make sure that you are in the scripts directory when you run it and try again, let me know the results.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
karlkatzke
Posts: 10
Joined: Sun Apr 03, 2005 4:29 pm
Location: Tigard, OR

Post by karlkatzke »

I'm having the same exact issue and get this result:

Code: Select all

# /usr/bin/php -q /usr/local/cacti/scripts/query_host_cpu.php 192.168.0.2 public 1 query index
No input file specified.
elnino
Cacti User
Posts: 205
Joined: Tue Mar 08, 2005 9:51 pm

Post by elnino »

rony wrote:Do not copy old file over to the new installation, I don't think it will make a difference.

I have much concern over the following error:

Code: Select all

PHP Warning:  main(../include/config.php): failed to open stream: No such file or directory in /usr/local/cacti/scripts/query_host_cpu.php
Make sure that you are in the scripts directory when you run it and try again, let me know the results.
I removed the snmp_functions.php file and ran the command again as root from the scripts directory and this time just got the errors about not finding snmp_functions.php

Code: Select all

PHP Warning:  main(../include/snmp_functions.php): failed to open stream: No such file or directory in /usr/local/cacti/scripts/query_host_cpu.php on line 4
PHP Warning:  main(): Failed opening '../include/snmp_functions.php' for inclusion (include_path='.:/usr/lib/php') in /usr/local/cacti/scripts/query_host_cpu.php on line 4
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Please post results of "php -v". Verify that "register_arg..." is "On" in your PHP.INI file.

Thanks,

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
elnino
Cacti User
Posts: 205
Joined: Tue Mar 08, 2005 9:51 pm

Post by elnino »

TheWitness wrote:Please post results of "php -v". Verify that "register_arg..." is "On" in your PHP.INI file.

Thanks,

TheWitness
I'm using PHP 4.3.4 and register_argc_argv was Off, so I changed it to On and restarted Apache and verified it was now on from phpinfo(). I tried the "SNMP - Get Processor Information" data query again on my Unix host and still no information pulls back.
elnino
Cacti User
Posts: 205
Joined: Tue Mar 08, 2005 9:51 pm

Post by elnino »

Do you think upgrading net-snmp from version 5.0.9 to something newer would help?
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Maybe, I use 5.1.2 on my dev box. But I have used 5.0.x in production enviroments.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

I would get off PHP 4.3.4 myself.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
elnino
Cacti User
Posts: 205
Joined: Tue Mar 08, 2005 9:51 pm

Post by elnino »

Ok, I got PHP upgraded to 4.3.11 and still no rows pull for SNMP - Get Processor Information. I'll see if I can get net-snmp upgraded to 5.1.2 today before I leave work

Is there any other information you need to help fix my problem?
elnino
Cacti User
Posts: 205
Joined: Tue Mar 08, 2005 9:51 pm

Post by elnino »

Upgraded net-snmp to 5.1.2 with these options

Code: Select all

--prefix=/usr '--with-mib-modules=host smux' '--with-transports=UDP TCP Unix IPX' --with-persistent-directory=/var/net-snmp --with-default-snmp-version=1 --with-sys-contact=root@ --with-sys-location=SENTINIX --with-logfile=/var/log/snmpd.log --with-perl-modules --build=i386-sentinix-linux
Still not working
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Are you hosts snmpv2 or snmpv1?

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest