Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Status page scripts - Page 3
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Status page scripts

13»

Comments

  • joepie91 said: Wrote a status page script myself: http://kerpia.cryto.net:3720/

    Layout inspired by https://github.com/nikkiii/status and using a modified scrd.
    AJAX request asking for new stats is made every 30 seconds. I used to collect stats every 10 seconds, but some of my servers didn't really like that - I should look into making it do persistent connections. As for how it works, the stats are retrieved in JSON format and processed client-side with a bit of javascript-fu :)
    (will release source code when I cleaned it up, it's a horrible mess right now)

    Wow O_O Just noticed your script, almost the best I've seen so far. Would be great if you make that public.

    @luis123456 : Why indicators (PNG images) are not showing in your script? Seems to me as there is something with the bar.php coding, or something not enabled from my side.

  • Go59954 said: @luis123456 : Why indicators (PNG images) are not showing in your script? Seems to me as there is something with the bar.php coding, or something not enabled from my side.

    Well, it works on all VPS I have. I multi tested it. Maybe new openvz is breaking it?

    Here's a demo: http://20host.tk/info

  • Go59954Go59954 Member
    edited September 2011

    luis123456 said: Well, it works on all VPS I have. I multi tested it. Maybe new openvz is breaking it?

    Here's a demo: http://20host.tk/info

    Thanks a lot :) It turned to be the GD isn't installed in that VPS, while in my other VPS it worked like chram. So, I run "sudo apt-get install php5-gd" and modified php.ini with: (extension_dir = "/usr/lib/php5/modules")<-- or adding whatever the path to shared objects directory. Restarted Apache , and GD library is working in the VPS that didn't show indicators earlier, indicators are showing thereafter :)

    btw, nice, and awesome one, luis :) IMHO it can even be further improved if

    1) Removing "System Info" and "Other Stuff" bars.
    2) Creating a simple "central webpage" and include each three server status pages in it displayed next to each other in one row.
    3) That webpage can be in JS too, and automatically refresh the scripts every x seconds.
    4) We can use an .htaccess file (for Apache, or equivalent method for Nginx and others) to restrict access to PHP script on each VPS to just the server that hosts the "central page".

    Just thoughts for simple customization, but not doing it currently, even though i'm solely in the meantime depending on a ping service monitoring my sites uptime.
    And again.....thanks to you.

  • why am i getting getCpuUsage(): couldn't access STAT path or STAT file invalid

  • @sandoz : Is the page displaying at all, or it's displaying but CPU info isn't? What do you get in error log? also what os running in your VPS?

  • cedric said: Check the ticket section, there's one that cralor made. I didn't really add an how to when I released it as I didn't think it would pick up the popularity it had

    Just a little problem. How to add a server in the sqlite db.

  • no one wants to share how they did it? I can't seem to get it to work on my VPS :(

  • LivingSouLLivingSouL Member
    edited October 2011

    Can someone please help?

    PHP Warning:  require(Net/Ping.php): failed to open stream: No such file or directory in /var/www/cron.php on line 21
    PHP Fatal error:  require(): Failed opening required 'Net/Ping.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/cron.php on line 21
    

    And nothing displays on the index.php too ...

  • kiloservekiloserve Member
    edited October 2011

    LivingSouL said: Can someone please help?

    That error tells you that the cronjob cannot find your Ping.php file.

    Make sure the Ping.php file is actually on your system. If it is, the file path is probably wrong.

    It looks like your system cannot locate the Ping.php script.

    You can do 2 things,

    1) Edit your php include path to the directory where Ping.php actually resides, you need the FULL path.
    
    2) Edit /var/www/cron.php for the full path to Ping.php
    
    You can locate Ping.php on a CentOS system with these 2 commands (first command updates your file database and second actually searches for the full path to the file:
    
    updatedb
    locate Ping.php
    
  • tuxtux Member

    apt-get install php-net-ping

  • @kiloserve: I've done what you've said:

    # locate ping.php
    /usr/share/cacti/site/lib/ping.php
    /usr/share/cacti/site/scripts/ss_fping.php
    

    then I added this code on the cron.php

    <?php
    // Works as of PHP 4.3.0
    //set_include_path('/usr/lib/pear');
    
    // Works in all PHP versions
    ini_set('include_path', '/usr/share/cacti/site/lib');
    ?>
    

    @tux: thanks and done..

    but...

    I'm not getting any results yet. Index.php is just blank on my browser.

  • kiloservekiloserve Member
    edited October 2011

    LivingSouL said: locate ping.php

    Hi LivingSoul, that's the wrong Ping.php

    It's "Ping.php" (Capital P...Winbloze doesn't care but Linux is case sensitive).

    updatedb
    locate Ping.php
  • @kiloserve: oh yeah..

    # locate Ping.php
    /usr/share/php/Net/Ping.php
    

    changed the include path also on cron.php but nothing still? :(

  • Are you still getting the stream not found error?

    Please post any additional errors or confirm you are still getting same error.

  • @LivingSouL: Type pear install Net_Ping

  • @tortau:

    # pear install Net_Ping
    
    pear/Net_Ping is already installed and is the same as the released version 2.4.5

    @kiloserve: nope, i'm not getting any errors now, but still nothing displayed on the browser, as in blank. I'm not sure if it's processing or not. scrd is running though. thanks for the replies.. :(

  • did you add any servers to the database?

  • how? :-|

  • kiloservekiloserve Member
    edited October 2011

    LivingSouL said: nope, i'm not getting any errors now

    That is good, it is no longer an issue with Ping.php and is probably running correctly on the PHP side. You did edit config.php, right?

    If yes, your issue is probably on the scrd side.

    Did you edit scrd.conf and is scrd running?

  • LivingSouLLivingSouL Member
    edited October 2011

    oh there it is, http://stats.marcroger.com/

    can you please teach me how to add a server? thanks.

  • kiloservekiloserve Member
    edited October 2011

    That is good, it looks like you have the "display" portion of this completed, you are missing the data collection/stats portion I believe.

    LivingSouL said: can you please teach me how to add a server? thanks.

    Have you installed and configured scrd yet?

  • cedriccedric Member
    edited October 2011

    LivingSouL said: how? :-|

    You should be able to:

    sqlite3 servers.db

    INSERT INTO "servers" VALUES('Unique ID','Hostname/IP','Node Name/Number','Provider',0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

    .quit

  • @cedric: thanks! now something actually shows on the page...

    @kiloserve: yep, installed, configured and it's running on #2, where the stats is hosted (Debian). I'm having a hard time running scrd on CentOS, #1,3 and 4.

  • LivingSouLLivingSouL Member
    edited October 2011

    ah! i got it... the problem was the path. it should be ini_set('include_path', '/usr/share/php'); instead of /php/Net...

    now on to the JSON for CentOS 5.7... hmmmm

  • fanfan Veteran

    LivingSouL said: configured and it's running on #2, where the stats is hosted (Debian). I'm having a hard time running scrd on CentOS, #1,3 and 4.

    Seems I'm having the same issue with you, scrd's running but no statistics info shows up on the page. The Last Updated shows a weird number. Any ideas?

  • LivingSouL said: I'm having a hard time running scrd on CentOS, #1,3 and 4.

    Sounds like Kujoe found the fix for the CentOS issue:

    Replace all instances of "json" with "simplejson" in the scrd file. (BTW, I'm using CentOS 5.6.)

    or

    change "import json" to "import simplejson as json"

  • LivingSouLLivingSouL Member
    edited October 2011

    fan said: Seems I'm having the same issue with you, scrd's running but no statistics info shows up on the page. The Last Updated shows a weird number. Any ideas?

    Yes, are you running debian? If you are, here's what I did.

    updatedb
    locate Ping.php

    and then it'll output something like

    # locate Ping.php
    /usr/share/php/Net/Ping.php
    

    then put the location on your cron.php like this on the first line

    <?php
    ini_set('include_path', '/usr/share/php');
    ?>
    
    

    and it should collect something on your stats page. And also check your firewall if it allows the port you've set to the scrd.conf and config.php

    kiloserve said: change "import json" to "import simplejson as json"

    Thank you very much! I really appreciate your help. It's now displaying :D
    http://stats.marcroger.com

    One question though, this doesn't display the processes right?

  • fanfan Veteran

    LivingSouL said: and it should collect something on your stats page. And also check your firewall if it allows the port you've set to the scrd.conf and config.php

    I found why it's not working for me, I've pointed the wrong php binary path in the cronjob since I'm using a self-compiled php. Now everything works well for me. Thanks.

  • cool! :)

Sign In or Register to comment.