Page 1 of 3 123 LastLast
Results 1 to 20 of 43

Thread: A new virtual host monitor

  1. #1
    Join Date
    Apr 2008
    Posts
    55

    A new virtual host monitor

    Something I built while trying to remember c++.

    http://freshmeat.net/projects/topvhost

    Could use some beta testing. Any input welcome.

  2. #2
    Join Date
    Jun 2003
    Location
    California
    Posts
    26,123
    Just install it and run it, and it works?

    Jeff
    +1 951 643-5345
    Third-Party DirectAdmin administration and support
    Dedicated Servers, Dedicated Reseller Accounts
    NoBaloney Internet Services div. Qnito Incorporated
    848 North Rainbow Blvd., Suite #3789
    Las Vegas, NV 89107-1103

  3. #3
    Join Date
    Apr 2008
    Posts
    55
    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 by gaw; 08-20-2009 at 01:53 PM.

  4. #4
    Join Date
    Mar 2005
    Posts
    5,270
    ncurses-devel needed.
    Floyd Morrissette Little Creek Solutions
    Web Hosting Solutions. XEN Virtual Private Servers, VMWare .....
    DirectAdmin Administration and Support
    Our focus is on quality customer support

  5. #5
    Join Date
    Mar 2005
    Posts
    5,270
    Quote Originally Posted by gaw View Post
    No need to even install:

    src/topvhost -vf./.tophvost
    src/topvhost -vf./.tophvost or
    src/topvhost -vf./.topvhost
    Floyd Morrissette Little Creek Solutions
    Web Hosting Solutions. XEN Virtual Private Servers, VMWare .....
    DirectAdmin Administration and Support
    Our focus is on quality customer support

  6. #6
    Join Date
    Mar 2005
    Posts
    5,270
    Totally awesome. Thanks. This helps me determine accounts that may be overloading the server.
    Floyd Morrissette Little Creek Solutions
    Web Hosting Solutions. XEN Virtual Private Servers, VMWare .....
    DirectAdmin Administration and Support
    Our focus is on quality customer support

  7. #7
    Join Date
    Aug 2008
    Posts
    4,697
    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!

  8. #8
    Join Date
    Apr 2008
    Posts
    55
    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....

  9. #9
    Join Date
    Apr 2008
    Posts
    55
    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
    Last edited by gaw; 08-13-2009 at 06:43 PM.

  10. #10
    Join Date
    Feb 2007
    Posts
    439
    So do you have some instructions on this?

  11. #11
    Join Date
    Apr 2008
    Posts
    55
    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 by gaw; 08-14-2009 at 05:14 AM.

  12. #12
    Join Date
    Aug 2008
    Posts
    4,697
    Quote Originally Posted by gaw View Post
    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'

  13. #13
    Join Date
    Mar 2005
    Posts
    5,270
    scsi: What OS are you using? I compiled it on CentOS with no problem once I install ncurses-devel.
    Floyd Morrissette Little Creek Solutions
    Web Hosting Solutions. XEN Virtual Private Servers, VMWare .....
    DirectAdmin Administration and Support
    Our focus is on quality customer support

  14. #14
    Join Date
    Aug 2008
    Posts
    4,697
    ubuntu 9.04

  15. #15
    Join Date
    Apr 2008
    Posts
    55
    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.

  16. #16
    Join Date
    Apr 2008
    Posts
    55
    scsi: Not yet public (and I want to sit on this for a while)

    http://www.issihosts.com/topvhost/topvhost-0.4.tar.gz

    Builds cleanly for me on heron (other box busted)....

  17. #17
    Join Date
    Sep 2005
    Posts
    366
    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

  18. #18
    Join Date
    Mar 2005
    Posts
    5,270
    Version 0.3 works on CentOS. I have not tried 0.3a.
    Floyd Morrissette Little Creek Solutions
    Web Hosting Solutions. XEN Virtual Private Servers, VMWare .....
    DirectAdmin Administration and Support
    Our focus is on quality customer support

  19. #19
    Join Date
    Apr 2008
    Posts
    55
    Code:
    monitor.cpp:26:25: sys/inotify.h: No such file or directory
    What version of CentOS? You need a 2.6.13 or better kernel

    http://manpages.courier-mta.org/htmlman7/inotify.7.html

  20. #20
    Join Date
    Sep 2005
    Posts
    366
    We only have boxes with 4.7 and a 2.6.9-11.ELsmp kernel. So that's the problem maker.

Page 1 of 3 123 LastLast

Similar Threads

  1. Create File under /etc/virtual/DOMAINS/monitor via DA Plugin
    By defomaz in forum General Technical Discussion & Troubleshooting
    Replies: 2
    Last Post: 02-05-2013, 07:32 AM
  2. Virtual Host Overlap?
    By Rewt in forum System-Level Technical Discussion
    Replies: 3
    Last Post: 08-02-2011, 10:24 AM
  3. Virtual Host
    By lacrimos in forum General Technical Discussion & Troubleshooting
    Replies: 0
    Last Post: 12-03-2006, 11:31 AM
  4. Virtual Host Standardisation
    By thoroughfare in forum Feedback & Feature Requests
    Replies: 4
    Last Post: 04-19-2004, 12:27 PM
  5. Virtual Host
    By S2S-Robert in forum Admin-Level Difficulties
    Replies: 13
    Last Post: 09-09-2003, 08:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •