SNMP Error (oh no!)

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

Moderators: Developers, Moderators

Post Reply
SamuelHenderson
Posts: 8
Joined: Wed Jan 10, 2007 3:38 pm

SNMP Error (oh no!)

Post by SamuelHenderson »

Hey,

Sorry to bother you all, but I can't seem to find the solution to this on my own (or in the FAQ or in these forums).

My environment is Windows 2003 Server SE running in a VM. All firewalls are off.

The specific problem I getting is that I see the message "SNMP Error" in my devices page. The interesting thing there is that when I try to add a device as per the installation instructions I recieve this when pressing create:
[code]
Warning: exec() [function.exec]: Unable to fork [c:\php\php.exe -q C:\Inetpub\wwwroot\cacti\scripts\ss_host_disk.php localhost 4 1:161:500:public:::MD5::[None] index] in C:\Inetpub\wwwroot\cacti\lib\functions.php on line 1217

Warning: exec() [function.exec]: Unable to fork [c:\php\php.exe -q C:\Inetpub\wwwroot\cacti\scripts\ss_host_disk.php localhost 4 1:161:500:public:::MD5::[None] query index] in C:\Inetpub\wwwroot\cacti\lib\functions.php on line 1217

Warning: exec() [function.exec]: Unable to fork [c:\php\php.exe -q C:\Inetpub\wwwroot\cacti\scripts\ss_host_disk.php localhost 4 1:161:500:public:::MD5::[None] query description] in C:\Inetpub\wwwroot\cacti\lib\functions.php on line 1217

Warning: exec() [function.exec]: Unable to fork [c:\php\php.exe -q C:\Inetpub\wwwroot\cacti\scripts\ss_host_disk.php localhost 4 1:161:500:public:::MD5::[None] query sau] in C:\Inetpub\wwwroot\cacti\lib\functions.php on line 1217

Warning: exec() [function.exec]: Unable to fork [c:\php\php.exe -q C:\Inetpub\wwwroot\cacti\scripts\ss_host_cpu.php localhost 4 1:161:500:public:::MD5::[None] index] in C:\Inetpub\wwwroot\cacti\lib\functions.php on line 1217

Warning: exec() [function.exec]: Unable to fork [c:\php\php.exe -q C:\Inetpub\wwwroot\cacti\scripts\ss_host_cpu.php localhost 4 1:161:500:public:::MD5::[None] query index] in C:\Inetpub\wwwroot\cacti\lib\functions.php on line 1217

Warning: Cannot modify header information - headers already sent by (output started at C:\Inetpub\wwwroot\cacti\lib\functions.php:1217) in C:\Inetpub\wwwroot\cacti\host.php on line 151
[/code]

I have verified all permissions in <webroot>/cacti (and subdirectories) for the specific users mentioned in the install guide.

I have verified that php is configured to load snmp by the following:
[code]
C:\Documents and Settings\Administrator>cd\

C:\>php -m
c:\net-snmp\etc\snmp/snmp.conf: line 2: Warning: Unknown token: persistentDir.
c:\net-snmp\etc\snmp/snmp.conf: line 3: Warning: Unknown token: tempFilePatter

[PHP Modules]
bcmath
calendar
com_dotnet
ctype
date
dom
filter
ftp
hash
iconv
json
libxml
mysql
odbc
pcre
Reflection
session
SimpleXML
snmp
sockets
SPL
standard
tokenizer
wddx
xml
xmlreader
xmlwriter
zlib

[Zend Modules]


C:\>
[/code]

running snmpwalk -v 1 -c public 127.0.0.1 system yeilds:
[code]
C:\>snmpwalk -v 1 -c public 127.0.0.1 system
Cannot find module (NOTIFICATION-LOG-MIB): At line 1 in (none)
Cannot find module (NET-SNMP-AGENT-MIB): At line 1 in (none)
Cannot find module (DISMAN-EVENT-MIB): At line 1 in (none)
Timeout: No Response from 127.0.0.1
[/code] Although earlier it was just reporting No response, not sure what I've changed since then.

Any thoughts?

edit:

I also got the following error message the first two times I tried to post this:

Error in posting

[code]
DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' forum_topics = forum_topics + 1 WHERE forum_id = 3' at line 2

UPDATE forums SET forum_posts = forum_posts + 1, forum_last_post_id = , forum_topics = forum_topics + 1 WHERE forum_id = 3

Line : 423
File : functions_post.php

[/code] Disabling BBCode fixed this.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

1) Sounds like you haven't properly configured the snmp agent. make sure you set a community and allowed host(s).

2) Those fork errors are typically attributed to NTFS permissions which are wrong. Fire up Sysinternals Filemon and look what is getting access denied and/or post its log.

3) Those 'Cannot find module ' errors are typically related to either not having set the MIBDIRS system variable and/or not having those mib files in the MIBDIR directory. Cacti doesn't use mib files directly, but it'll make those errors go away.
SamuelHenderson
Posts: 8
Joined: Wed Jan 10, 2007 3:38 pm

Graphs aren't displayed

Post by SamuelHenderson »

1) Yup, had to create snmpd.conf and add rocommunity public, then I had to register snmp-agent as a server using registeragent.bat, finally I had to start the service using net start "net-snmp agent". No more SNMP errors :D

2) It was an issue with cmd.exe not having the correct permissions. I must be getting old since I spefically remember thinking: "I'll need to change the permissions on that later" and then going to lunch...

3)Yeah, I took the net-snmp's mib path out of the MIBDIRS path for troubleshooting purposes, I can't believe I didn't put it back in. Oh well.

Now however,

4)Instead of ugly fork errors I get a blank page and must manually click 'back'. The new device is added fine however.

5)I cannot seem to see the graphs. They appear as littly boxes with an "X" in them. It looks like it cannot find the picture. (I'm using IE7 btw, and for the record, I never tried viewing the graphs before)

Any new thoughts?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

1) Why did you install the net-snmp agent instead of the microsoft one? You cannot have both running at the same time. The Microsoft agent is the preferred one.

4) Interesting. What version of php are you using? if 5.2.0, there is a bug with it and cacti so go back to 5.1.6.

5) Make sure you have the correct rrdtool version selected in cacti's settings. Click on graph management, then a graph and then click on enable graph debugging. Whats the error?

My guess is that cacti's hasn't collected any data since you're using the net-snmp agent...
SamuelHenderson
Posts: 8
Joined: Wed Jan 10, 2007 3:38 pm

Post by SamuelHenderson »

1)I installed net-snmp because when I went to download Cacti it says this: "Cacti requires MySQL, PHP, RRDTool, net-snmp" So I figured I needed it.

4)Yeah, I'm using PHP 5.2. Looks like I'm going back to php 5.1.6 :S
5) This is what the debugging said:

RRDTool Command:

C:/Inetpub/wwwroot/cacti/rrd/rrdtool.exe graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Windows Server 2003 Local host - Logged in Users" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="users" \
--slope-mode \
DEF:a="C\:/Inetpub/wwwroot/cacti/rra/windows_server_2003_local_host_users_8.rrd":users:AVERAGE \
AREA:a#4668E4:"Users" \
GPRINT:a:LAST:"Current\:%8.0lf" \
GPRINT:a:AVERAGE:"Average\:%8.0lf" \
GPRINT:a:MAX:"Maximum\:%8.0lf"
RRDTool Says:

ERROR: opening 'C:/Inetpub/wwwroot/cacti/rra/windows_server_2003_local_host_users_8.rrd': No such file or directory

I'm guessing that the last line is a problem :wink: I'm further guessing that you are right about there being no data to graph.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

SamuelHenderson wrote:1)I installed net-snmp because when I went to download Cacti it says this: "Cacti requires MySQL, PHP, RRDTool, net-snmp" So I figured I needed it.
While that statement is partially true, if you read through my installation guide it clearly states only the net-snmp tools are needed -- not the snmp agent.
SamuelHenderson
Posts: 8
Joined: Wed Jan 10, 2007 3:38 pm

SNMP walking times out

Post by SamuelHenderson »

Ok. I can't figure out what the problem is. I have made sure that my SNMP (the microsoft one is configured properly)

I've attached some screenshots of my SNMP configurations. Using snmpwalker -v 1 -c localhost gives: Timed out: no response from local host.

There is another test server that has snmp turned on, when I walk it's ip address I get tons o' stuff. It appears to just be this machine that I cannot walk.

I have no firewalls turned on. Attatchment 3 is the result of "netstat -a";
Attachments
snmpsetting_001.PNG
snmpsetting_001.PNG (11.99 KiB) Viewed 5154 times
I tried adding 127.0.0.1 to the destination but that did not work
I tried adding 127.0.0.1 to the destination but that did not work
snmpsetting_002.PNG (12.82 KiB) Viewed 5154 times
netstat-a.PNG
netstat-a.PNG (20.28 KiB) Viewed 5154 times
SamuelHenderson
Posts: 8
Joined: Wed Jan 10, 2007 3:38 pm

Whoops

Post by SamuelHenderson »

I realized just before leaving work that the reason I was having the problem was because I had my community names mismatched. One was 'public' one was 'Public'. It was a simple case problem. Sorry for wasting your time :)

Tomorrow I WILL get the graphing working :D
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests