Get SNMP data problem - Please Help

Post support questions that relate to the Windows 2003/2000/XP operating systems.

Moderators: Developers, Moderators

Post Reply
MontyP

Get SNMP data problem - Please Help

Post by MontyP »

I got cacti 0.6.8 installed and working on W2K, IIS5. I've been doing reading and trying to find tutorials.

I am trying to create a graph that shows Access Point registrations by using SNMP. I have a SNMPGET utility that work like this:
snmpget IP community OID

If I run it from the command line I get the number for that OID, however I'm not sure what I"m doing wrong in the Data Input Source Configuration.

Get SNMP Data is set up as "INTERNAL: <ip> <community> <oid>". Is this wrong? Does this need to be changed?

When I run the CMD.PHP I get a "No Response" error from the IP I'm trying to get the SNMP data.

Thanks in advance,
MP
Jessie Blue
Posts: 3
Joined: Mon May 12, 2003 8:06 am
Location: Germany
Contact:

Get SNMP Data

Post by Jessie Blue »

Hi,

you are running an own script not the one included in cacti, aren't you? So you can't write INTERNAL, because this means the script of cacti.

You must write something like "perl <path_cacti>/scripts/yourscript.pl <ip> <community> <oid>" if your script is a Perl-Script. And don't forget to define the output string.

But: why aren't you using the Get SNMP Data - Data Input from cacti. You can define a new Data Source and then add all of this above (IP, Community, OID). It would be the same!

Bey,
Jessie
MontyP
Posts: 13
Joined: Mon May 12, 2003 9:56 am
Location: Canada
Contact:

Win2k - SNMP (solution) and Ping (help)

Post by MontyP »

Jessie,

Thanks for the reply. I've discovered several things to tweak Cacti for Win32 as I do more and more digging. Perhaps someone can add the following tips on a Win32 FAQ or something.

1. make sure that PHP.INI has the SNMP.dll loaded otherwise the internal SNMP functions won't work
2. create c:\usr\mibs and copy all c:\php\mibs here (this way you won't get errors show up on the screen from the php script when it runs)
3. edit PHP.INI file for max_execution_time = 240 instead of 30 (this will take care of the Maximum execution time of 30 seconds exceeded error).

Obviously I've managed to get the SNMP Data working just fine as well as the SNMP Network working.

I'm still having problems with the ping script under Win2k, not sure what I need to get this to work. I'd appreciate help from anyone who has the ping running under win2k.

MP
mcarrick
Posts: 5
Joined: Tue Jun 17, 2003 4:56 pm

Post by mcarrick »

This sounds like the problem I am having!

When I try to collect snmp data, I am told that function.php errors at lines 240,241.

Modifying php.ini to use the php_snmp.dll DOES change the error message, so I seem to be in the right place. What I am now getting every 5 minutes is a popup telling me that php_snmp.dll can't be found.

I found that I LACK php_snmp.dll altogether.
Where do I get that file?

Thanks!

Also - I don't have a mibs directory in /php ??
where does that come from?
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

The file comes with standard windows php distribution and is placed in \php\extensions folder. Also \php\mibs with contents is created by installer. You may try to reinstall your php.

- bulek
mcarrick
Posts: 5
Joined: Tue Jun 17, 2003 4:56 pm

Post by mcarrick »

Actually I find that in php/extensions I DO have php_snmp.dll.
I also found the mibs directory.

What I infer from the following is that I am still not opening an SNMP session:
###############################
snmp: 10.175.255.113, dsname: 5sec_cpu, oid: .1.3.6.1.4.1.9.9.109.1.1.1.1.3.1, value:
Warning: fopen(c://webroot//cacti//install//index.php/cacti/log/rrd.log): failed to open stream: No such file or directory in c:\webroot\cacti\include\functions.php on line 239

Warning: fwrite(): supplied argument is not a valid stream resource in c:\webroot\cacti\include\functions.php on line 240

Warning: fclose(): supplied argument is not a valid stream resource in c:\webroot\cacti\include\functions.php on line 241

################################
The fact that I fail to open a stream suggests to me that SNMP has not really connected yet.

Any debug ideas??

-mc-
mcarrick
Posts: 5
Joined: Tue Jun 17, 2003 4:56 pm

Post by mcarrick »

I forgot to mention that I was forced to copy php_snmp.dll to the /php root to get the dll not found popup to go away.
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

Hmm... I don't have to move snmp_php.dll anywhere. Maybe you have incorrectly set extension_dir in php.ini. This should be something like:
extension_dir = "c:\php\extensions"

- bulek
mcarrick
Posts: 5
Joined: Tue Jun 17, 2003 4:56 pm

Post by mcarrick »

Yes, that was it. Thank you.

Once I figured out that php appeared to be confused I went to php.ini and poked around and got rid of that './'

I do seem to be getting data points, although in the Utilities, when I view the SNMP cache I find that it is empty.

I seem to be up and running!!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests