cactid can't connect to mysql database

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

Moderators: Developers, Moderators

Post Reply
ioiioi
Cacti User
Posts: 52
Joined: Mon Mar 28, 2005 8:57 am

cactid can't connect to mysql database

Post by ioiioi »

when I changed the poller method to cactid, there is an error
php poller.php log:
08/07/2005 11:30:43 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Proces
s [CMD: C:\apache2\Apache2\htdocs\cacti\cactid\cactid.exe, ARGS: 0 22]
Waiting on 1/1 pollers.
Waiting on 1/1 pollers.
Waiting on 1/1 pollers.
Waiting on 1/1 pollers.
Waiting on 1/1 pollers.

cactid.exe log:
CACTID: Using cactid config file [cactid.conf]
CACTID: MYSQL: Connection Failed: Host 'test001.sccgd.swirebev.com' is not allow
ed to connect to this MySQL server

I am sure my cactid.conf was configured correctly.
anybody know how to solve this problem?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

1) Are you able to connect to your mysql machine from your cacti machine using the mysql admin tool?
2) Firewall(s) blocking traffic?
3) MySQL permissions allow the cacti user to connect from your cacti machine?
ioiioi
Cacti User
Posts: 52
Joined: Mon Mar 28, 2005 8:57 am

Post by ioiioi »

May be there is a problem between php and mysql, not business of cacti, because when I use phpmyadmin to manage mysql, the "cactiuser" work just fine, but the "root" account is not as good as "cactiuser", It is so strange, I have lost my mind. :(
AnyWay, thank for BSOD2000's reply.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

If you're using mysql 5.x with php 4.x, then you'll need to use the old password trick to get them communicating.

From your cacti box, use the mysql admin tool (c:\mysql\bin\mysql.exe) and try to connect to your mysql machine, with the same credentials as you've specified in your cactid.conf file. Does it work?
User avatar
adrianmarsh
Cacti User
Posts: 437
Joined: Wed Aug 17, 2005 8:51 am
Location: UK

Post by adrianmarsh »

I've been trying to switch from cmd.bat to cactid, but when I do it no data is recorded (at least the graphs stop updating).

If I run cactid from the command line I get :

C:\cactid>cactid
CACTID: Using cactid config file [cactid.conf]
CACTID: MYSQL: Connection Failed: Can't connect to local MySQL server through so
cket '/tmp/mysql.sock' (2)

The config file has the same db/user/passwd details as cacti.

I've tried swapping the cygwin dlls with the ones in rrdtool, but no difference.

Using: MySQL:4.1, PHP4. Mysql is on same box (localhost), W2K Server, no firewalls, Administrator tool has no problem with either root or cacti user.

Am I right in thinking, that I still need the scheduled task with cactid ? Doesn't the "d" stand for daemon ? Will this speed up the production of graphs, or just the data-collection ?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

1) Edit your cactid.conf and put in your IP (just like it says). Localhost does not work for win32 systems

2) Do not mix and match cygwin dlls on your system. I suggest you do a base install of cygwin so you do not keep multiple versions of the cygwin dlls laying around.

3) Do NOT schedule a task for cactid.exe. Always use poller.php. It will spawn cactid to run. Cactid will dramatically speed up the data collection process. rrdtool.exe creates the graphs.
User avatar
adrianmarsh
Cacti User
Posts: 437
Joined: Wed Aug 17, 2005 8:51 am
Location: UK

Post by adrianmarsh »

Hmm... something still didn't go quite right.

I only have poller.php scheduled, nothing else. I updated the .cfg to 127.0.0.1

Monitoring the scheduled tasks, and the Task Manager:

- I saw the poller task start, then I saw the cactid.exe start and a few secs later end. Checked logs, and saw cactid entry saying it had run.
- No update in the graphs though. Waited 5 mins
- Then the next scheduled task ran, but no cactid.exe this time - 30s later the task was still running, but still no cactid.exe. another 20s later I decided to halt it manually.

Put system back to using cmd.bat

I'll test more on Monday.
spoonman
Cacti User
Posts: 305
Joined: Tue May 03, 2005 8:54 am
Location: GA

Post by spoonman »

Guys>>> note this thread....
http://forums.cacti.net/viewtopic.php?t ... ght=cactid
I had similar issues setting up cactid... it was a combination of using the old_password setting and also enabling All Privileges to mysql for a few more things. WORKs.
User avatar
adrianmarsh
Cacti User
Posts: 437
Joined: Wed Aug 17, 2005 8:51 am
Location: UK

Post by adrianmarsh »

Should the scheduled task remain running all the time when cactid is used? (i.e. only start once every 72 hours) ?
spoonman
Cacti User
Posts: 305
Joined: Tue May 03, 2005 8:54 am
Location: GA

Post by spoonman »

My server runs on Debian, and I made no change to my cron job which is the same thing,,,, My poller.php runs every 5 mins just like before using cmd.php i just changed to cactid on the poller page in cacti. I had more issued getting cactid to work. So i guess answer would be yes. Dont make any changes to your scheduled job.
User avatar
adrianmarsh
Cacti User
Posts: 437
Joined: Wed Aug 17, 2005 8:51 am
Location: UK

Post by adrianmarsh »

I just don't get it. I've tied putting 127.0.0.1, swocmpq03, 135.86.80.3 - all three possible entries for the servername.

The logs seem to show that everything i ok:

08/25/2005 09:56:07 PM - SYSTEM STATS: Time: 5.7523 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 14, Hosts/Process: 14, Data Sources 364, RRDs Processed 198
08/25/2005 09:54:42 PM - SYSTEM STATS: Time: 3.5974 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 14, Hosts/Process: 14, Data Sources 364, RRDs Processed 198
08/25/2005 09:52:26 PM - SYSTEM STATS: Time: 3.5547 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 14, Hosts/Process: 14, Data Sources 364, RRDs Processed 198
08/25/2005 09:51:59 PM - SYSTEM STATS: Time: 3.6818 s, Method: cactid, Processes: 1, Threads: 1, Hosts: 14, Hosts/Process: 14, Data Sources 364, RRDs Processed 198


But theres no data in the graphs when using cactid..
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

For testing/debugging purposes only, you can run cactid by itself. I suggest you have Poller Logging Level at Debug, so you can see what is going on.

In MySQL, did you set your cacti user can connect from 127.0.0.1 or 135.86.80.3 ?

No, the scheduled task should not be running all the time. If thats the case, something is hanging. turn on debug and hopefully it will show something useful.
User avatar
adrianmarsh
Cacti User
Posts: 437
Joined: Wed Aug 17, 2005 8:51 am
Location: UK

Post by adrianmarsh »

Ok... I figured out that it was still the cygwin dll (maybe). Deleted the one in the cactid directory and now I get :

C:\Inetpub\wwwroot\cacti>php poller.php
No log handling enabled - turning on stderr logging
NOTIFICATION-LOG-MIB: Module not found
NET-SNMP-AGENT-MIB: Module not found
OK u:0.01 s:0.03 r:3.02
OK u:0.01 s:0.03 r:3.04
OK u:0.01 s:0.03 r:3.06
OK u:0.01 s:0.03 r:3.08
OK u:0.01 s:0.03 r:3.10
OK u:0.01 s:0.03 r:3.13
...... etc

I'm watching it for 10mins or so to see what happens..
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

looks like good output to me so far. You can ignore those mib errors, since cacti/cactid does not use them.
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests