Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


boost server not working (was: boost ondemand update not wor

 
Post new topic   Reply to topic    Cacti Forum Index -> Plugin General
Author Message
Atkatla



Joined: 14 Apr 2008
Posts: 41

PostPosted: Mon Aug 04, 2008 6:41 pm    Post subject: boost server not working (was: boost ondemand update not wor Reply with quote

Hi,
I got cacti 0.8.7b with spine and PIA 2.1 running. I recorded about 8k datasources with spine, there where no problems. PIA is working with monitor and RRDclean. Then I installed Boost1.7 (from the trunk directory in the SVN depository) to circumvent the pollerproblem.
When Boost is activated, the graphs are only drawn until the moment of the last scheduled update (currently hourly). If I understood correctly the graphs should also be updated, when I open a diagram, so I dont have to wait one hour to see the data of the last hour. This error happens with the non-SVN-Version,too.

I dont use the boost server. I tried, perhaps it could solve the problem, but when I wanted to do "chkconfig --add cacti_rrdsvc" I get the following output:
Code:
cacti:/etc/init.d # chkconfig --add cacti_rrdsvc
insserv: script cacti_rrdsvc is not executable, skipped!
cacti_rrdsvc              0:off  1:off  2:off  3:off  4:off  5:off  6:off

I did the dos2unix before but the original and dos2unix'ed file look like the same when I watch them with the "less"-command.

Can someone please bring some light into that topic? System is DualXeon with Opensuse11 and 4GB RAM.


Last edited by Atkatla on Thu Aug 07, 2008 10:06 am; edited 1 time in total
Back to top
gninja
Cacti User


Joined: 24 Aug 2004
Posts: 290
Location: San Francisco, CA

PostPosted: Wed Aug 06, 2008 5:59 pm    Post subject: Reply with quote

try:
Code:
chmod +x cacti_rrdsvc


On-demand update doesn't work if there's nothing to demand the update from.
Back to top
Atkatla



Joined: 14 Apr 2008
Posts: 41

PostPosted: Thu Aug 07, 2008 7:08 am    Post subject: Reply with quote

Ok, i did the "chmod +x cacti_rrdsvc" and then "dos2unix cacti_rrdsvc".
When I did "chkconfig --add cacti_rrdsvc" i got the following output:
Code:
insserv: warning: script 'S01cacti_rrdsvc' missing LSB tags and overrides
insserv: warning: script 'cacti_rrdsvc' missing LSB tags and overrides
cacti_rrdsvc              0:off  1:off  2:off  3:on   4:off  5:on   6:off


The service itself is running now, but not the server.
Code:

cacti:/etc/init.d/rc5.d # ps -ef | grep boost_server.php
root     19338  6115  0 15:52 pts/0    00:00:00 grep boost_server.php

cacti:/etc/init.d/rc5.d  # telnet localhost 9050
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
Trying ::1...
telnet: connect to address ::1: Connection refused

Code:
cacti:/etc/init.d # php /srv/www/htdocs/cacti/plugins/boost/boost_server.php -d
2008:08:07 13:59:57 - Cacti RRDtool Service Started
but no more response.

Then I realized, that I forgot to change the path (I did it once, but then overwrote the file again when upgraded to Boost SVN). So I edited the file with my cacti path, but the result ist the same.

After dos2unix, my cacti_rrdsvc looks like:
Code:
#!/bin/bash
# [comments]
PROGPATH="/srv/www/htdocs/cacti/plugins/boost/"
PROG="boost_server.php"
[ -f $PROGPATH$PROG ] || exit 0
RETVAL=0
start() {
        echo -n $"Starting Cacti RRDTool Process: "
        if [ -e /var/lock/subsys/$PROG ]; then
                echo "    [  ESC[31;01mFAILESC[m  ]"
        else
                $PROGPATH$PROG > /dev/null 2>&1 &
                touch /var/lock/subsys/$PROG
                echo "    [  ESC[32;01m OK ESC[m  ]"
        fi
        return 0
}
stop() {
        echo -n $"Stopping Cacti RRDTool Process: "
        if [ -e /var/lock/subsys/$PROG ]; then
                killall $PROG > /dev/null 2>&1
                rm -f /var/lock/subsys/$PROG  > /dev/null 2>&1
                echo "    [  ESC[32;01m OK ESC[m  ]"
        else
                echo "    [  ESC[31;01mFAILESC[m  ]"
        fi
        return 0
}
restart() {
        stop
        start
}
status() {
        echo -n $"Status of Cacti RRDTool Process: "
        if [ -e /var/lock/subsys/$PROG ]; then
                echo "running ..."
        else
                echo "down"
        fi
        return 0
}
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart|reload)
        restart
        ;;
  status)
        status
    ;;
  *)
        echo $"Usage: $0 {start|stop|restart|status}"
        exit 1
esac
exit $?

How can I cleanly unistall the service, to try again? Was the dos2unix conversion correct?
Back to top
gninja
Cacti User


Joined: 24 Aug 2004
Posts: 290
Location: San Francisco, CA

PostPosted: Thu Aug 07, 2008 2:11 pm    Post subject: Reply with quote

It's a linux service now, you don't need to uninstall it, you just need to turn it on. You've set it up as a service, so it WILL turn on on reboots, but you still haven't started it.

Code:
./cacti_rrdsvc start


That should do it.
Back to top
Atkatla



Joined: 14 Apr 2008
Posts: 41

PostPosted: Thu Aug 07, 2008 2:40 pm    Post subject: Reply with quote

Nope, the service was running.
Code:
cacti:~ # service cacti_rrdsvc restart
Stopping Cacti RRDTool Process:     [   OK   ]
Starting Cacti RRDTool Process:     [   OK   ]
cacti:~ #  telnet localhost 9050
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
Trying ::1...
telnet: connect to address ::1: Connection refused
cacti:~ # php /srv/www/htdocs/cacti/plugins/boost/boost_server.php -d
2008:08:07 21:39:24 - Cacti RRDtool Service Started
^C
cacti:~ #
The RRDtool service does not react.
Back to top
gninja
Cacti User


Joined: 24 Aug 2004
Posts: 290
Location: San Francisco, CA

PostPosted: Thu Aug 07, 2008 2:48 pm    Post subject: Reply with quote

Try launching it yourself, again, and instead of ctrl-c'ing it, try telnetting again.

Also, when you ./cacti_rrdsvc start, is the php script actually running, or does it just say "Start OK" and not do anything?

Also, do you have selinux, or any other firewall software enabled?
Back to top
Atkatla



Joined: 14 Apr 2008
Posts: 41

PostPosted: Thu Aug 07, 2008 2:58 pm    Post subject: Reply with quote

I disabled the firewall.

Console 1:
Code:
cacti:~ # php /srv/www/htdocs/cacti/plugins/boost/boost_server.php -d
2008:08:07 21:56:06 - Cacti RRDtool Service Started
2008:08:07 21:56:18 - Host Connected '127.0.0.1'
2008:08:07 21:56:18 - Host Validated '127.0.0.1'

No further response on console 1.

The last 2 lines appeared when I connected via telnet on console 2:
Code:
cacti:~ # telnet localhost 9050
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

No further resonse on console 2.

TElnet session closes when I CTRL+C the PHP script in console 1.

edit:interesting:
Code:
cacti:~ # ./cacti_rrdsvc start
-bash: ./cacti_rrdsvc: No such file or directory
how can that be? I did all those chkconfig thingies...

Whats the difference between "./cacti_rrdsvc start" and "service cacti_rrdsvc start"? The ladder one works.


Last edited by Atkatla on Thu Aug 07, 2008 3:08 pm; edited 1 time in total
Back to top
gninja
Cacti User


Joined: 24 Aug 2004
Posts: 290
Location: San Francisco, CA

PostPosted: Thu Aug 07, 2008 3:07 pm    Post subject: Reply with quote

Well, before you were doing
Code:
service cacti_rrdsvc start


Which I didn't notice, so you're probably not in the same directory as that startup script.

So, just do what you did before, again. And all should be working happily.
Back to top
Atkatla



Joined: 14 Apr 2008
Posts: 41

PostPosted: Thu Aug 07, 2008 3:18 pm    Post subject: Reply with quote

Ahh, something with the autostart was/is wrong. The script is only running when I enable it via console. As soon as I close the console or CTRL+C it, the boost server goes down.

How do I solve that problem? I thought chkconfig --add cacti_rrdsvc did add it to runlevel 3 and 5? As I'm new to Unix please consider the typical beginner errors which I possibly made.

paste from an earlier post:
When I did "chkconfig --add cacti_rrdsvc" i got the following output:
Code:
insserv: warning: script 'S01cacti_rrdsvc' missing LSB tags and overrides
insserv: warning: script 'cacti_rrdsvc' missing LSB tags and overrides
cacti_rrdsvc 0:off 1:off 2:off 3n 4:off 5n 6:off
Back to top
gninja
Cacti User


Joined: 24 Aug 2004
Posts: 290
Location: San Francisco, CA

PostPosted: Thu Aug 07, 2008 3:22 pm    Post subject: Reply with quote

At that point, you should just be able to start the service and log out.

If not, then I don't know. Might be a weird compiliation error in php causing it to bind to your terminal. The devs might have a better idea, but I think they're all at Linux World today.
Back to top
Atkatla



Joined: 14 Apr 2008
Posts: 41

PostPosted: Thu Aug 07, 2008 3:39 pm    Post subject: Reply with quote

Thanks for the help.

According to a suggestion from TheWitness in another thread I did the following:
Code:
cactiuser@cacti:~/plugins/boost> php poller_boost.php -d -f
PHP Warning:  session_start(): open(/var/lib/php5/sess_316cqdkqbidoarujfl3tno0hvejtcbd4, O_RDWR) failed: Permission denied (13) in /srv/www/htdocs/cacti/include/global.php on line 148

This is one of those warnings which reads as if it shouldnt be there...
Could it be an access rights problem?
Back to top
TheWitness
Developer


Joined: 14 May 2002
Posts: 9671
Location: MI, USA

PostPosted: Thu Aug 07, 2008 4:46 pm    Post subject: Reply with quote

Yup, it's a permissions problem. Change that and you will be golden.

TheWitness
Back to top
Atkatla



Joined: 14 Apr 2008
Posts: 41

PostPosted: Thu Aug 07, 2008 4:56 pm    Post subject: Reply with quote

But change the permission of what file? /me=unix-noob
Back to top
Atkatla



Joined: 14 Apr 2008
Posts: 41

PostPosted: Fri Aug 08, 2008 9:57 am    Post subject: Reply with quote

It wasnt a permission problem.

I had to add "php" before "$PROGPATH$PROG" in the start/else section of the script. Now its working. Thanks for your help anyway.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Plugin General All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group