A new virtual host monitor

No need to even install:

./configure
make
src/topvhost -vf./.topvhost

Should show you the log files and sample a listing lines for the vhosts managed by DA. If that looks good replace "-vf" with "-f" to see why it is called curses (seriously - only a few display hicups). The app uses the inotify service in the 2.6 kernel so it can easily monitor 100s of log files and as long as none of the sites are too busy, the apps gives you something approaching a real-time view of virtual hosting.
 
Last edited:
Totally awesome. Thanks. This helps me determine accounts that may be overloading the server.
 
make[2]: Entering directory `/usr/local/src/topvhost-0.2/src'
g++ -DHAVE_CONFIG_H -I. -I.. -Wall -g -O2 -MT topvhost.o -MD -MP -MF .deps/topvhost.Tpo -c -o topvhost.o topvhost.cpp
topvhost.cpp: In member function 'void topvhost::getHeader()':
topvhost.cpp:91: error: 'strchr' was not declared in this scope
topvhost.cpp:93: error: 'strchr' was not declared in this scope
topvhost.cpp: In function 'int main(int, char**)':
topvhost.cpp:165: warning: deprecated conversion from string constant to 'char*'
topvhost.cpp:165: warning: deprecated conversion from string constant to 'char*'
topvhost.cpp:165: warning: deprecated conversion from string constant to 'char*'
topvhost.cpp:165: warning: deprecated conversion from string constant to 'char*'
topvhost.cpp:165: warning: deprecated conversion from string constant to 'char*'
topvhost.cpp:165: warning: deprecated conversion from string constant to 'char*'



Nooooooooooo! :(
 
There is a new .3 version out with some major restructuring (that method no longer exists), but I see strchr() is still used - us old c programmers find it hard to let go....
 
The only docs are at:

http://www.issihosts.com/topvhost/

The app just needs to be able to find the files it needs to monitor, have access to read them, and know how to transfer information from the log records to the screen. There is nothing peculiar to apache (other than LogFormat) or DA in that task and there are many different ways logging can be set up - that's why there is such a big configuration section.

Most DA folks can skip over the configuration section and use the sample configuration provided. The configuration section appears formidable because the app attempts to deal with anything LogFormat can throw at it with enough flexibility to handle the individual wrinkles of any hosting setup.

The app should be considered experimental at this point because I am looking for ideas on what way to take this project. Since the app is targeted to web hosting management, I expect most users should be able to handle a source tarball, and the g++, and ncurses-devel prerequisites. There is nothing particularly risky about giving it a spin - it only reads log files and probably the worst it could do is abend and leave your terminal in need of a reset.

BTW: The .3 version is now the same as the .3a version - there was no change in functionality (only a compilation issue) and only a couple of downloads of the original tarball
 
Last edited:
scsi:

Not public yet but

http://www.issihosts.com/topvhost/topvhost-0.3a.tar.gz

gets rid of strchr() and includes <string.h> for strlen

Got a new error:

g++ -DHAVE_CONFIG_H -I. -I.. -Wall -g -O2 -MT vhost.o -MD -MP -MF .deps/vhost.Tpo -c -o vhost.o vhost.cpp
vhost.cpp: In member function 'void vhost::paintHost(topvhost*)':
vhost.cpp:174: error: 'atoi' was not declared in this scope
make[2]: *** [vhost.o] Error 1
make[2]: Leaving directory `/usr/local/src/topvhost-0.3a/src'
 
scsi: What OS are you using? I compiled it on CentOS with no problem once I install ncurses-devel.
 
scsi: Ok I got one of those here somewhere. Not today, some sort of mysterious routing issue at superb.net I have to deal with.
 
Erroring out on CentOS with ncurses-devel installed.

Code:
make[1]: Entering directory `/usr/src/topvhost-0.3a'
Making all in src
make[2]: Entering directory `/usr/src/topvhost-0.3a/src'
g++ -DHAVE_CONFIG_H -I. -I..    -Wall -g -O2 -MT topvhost.o -MD -MP -MF .deps/topvhost.Tpo -c -o topvhost.o topvhost.cpp
mv -f .deps/topvhost.Tpo .deps/topvhost.Po
g++ -DHAVE_CONFIG_H -I. -I..    -Wall -g -O2 -MT config.o -MD -MP -MF .deps/config.Tpo -c -o config.o config.cpp
mv -f .deps/config.Tpo .deps/config.Po
g++ -DHAVE_CONFIG_H -I. -I..    -Wall -g -O2 -MT monitor.o -MD -MP -MF .deps/monitor.Tpo -c -o monitor.o monitor.cpp
monitor.cpp:26:25: sys/inotify.h: No such file or directory
monitor.cpp: In member function `void Monitor::init(topvhost*, appOptions)':
monitor.cpp:214: error: `inotify_init' was not declared in this scope
monitor.cpp:225: error: `IN_MODIFY' was not declared in this scope
monitor.cpp:225: error: `inotify_add_watch' was not declared in this scope
monitor.cpp:225: warning: unused variable 'IN_MODIFY'
monitor.cpp:225: warning: unused variable 'inotify_add_watch'
monitor.cpp:214: warning: unused variable 'inotify_init'
monitor.cpp: In member function `void Monitor::update(topvhost*)':
monitor.cpp:386: error: invalid application of `sizeof' to incomplete type `inotify_event' 
monitor.cpp:401: error: invalid application of `sizeof' to incomplete type `inotify_event' 
monitor.cpp:404: error: invalid application of `sizeof' to incomplete type `inotify_event' 
monitor.cpp:404: error: invalid use of undefined type `struct inotify_event'
monitor.cpp:386: error: forward declaration of `struct inotify_event'
monitor.cpp:406: error: invalid use of undefined type `struct inotify_event'
monitor.cpp:386: error: forward declaration of `struct inotify_event'
monitor.cpp:407: error: invalid use of undefined type `struct inotify_event'
monitor.cpp:386: error: forward declaration of `struct inotify_event'
monitor.cpp:407: error: `IN_MODIFY' was not declared in this scope
monitor.cpp:407: warning: unused variable 'IN_MODIFY'
make[2]: *** [monitor.o] Error 1
make[2]: Leaving directory `/usr/src/topvhost-0.3a/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/topvhost-0.3a'
make: *** [all] Error 2
 
We only have boxes with 4.7 and a 2.6.9-11.ELsmp kernel. So that's the problem maker.
 
Back
Top