Domain Monitoring Tool

Status
Not open for further replies.
That's just something that happens on DA servers. I'm not sure why it does, but every da server I've examined mod_status on does it.
 
HELP!!

This monitor sounds just right for me. Buttttttttt i can't get it to work.

What did I do:

I created a map in a domain from admin, in de private_html section.

I created the database and configured the configure.php. I cannot get a http address in there. Only the local address gave no errors.

I also added this to the /usr/local/directadmin/data/templates/httpd.conf:
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from localhost
</Location>
Exactly like this. Should I perhaps give a location ?
I then restarted httpd service.

I then run monitor.php and ' table updated' apears. But nothing changes. Am i missing something ?
 
It wont allow me to open the directory...

Warning: opendir(/usr/local/directadmin/data/users): failed to open dir: Permission denied in /home/admin/domains/mydomain.com/public_html/monitor2/lib/directadmin.php on line 36

Warning: readdir(): supplied argument is not a valid Directory resource in /home/admin/domains/mydomain.com/public_html/monitor2/lib/directadmin.php on line 37

Any one knows how to fix? The ownership of those folders /usr/local/directadmin/data/users to diradmin

thanks
 
Help!!!!

I have some bug or something...

[root@matrix:/home/admin/domain.monitor] php monitor.php
fatal error: UPDATE cpu_monitor SET status='warned' WHERE domain='games******.net'<p>mysql error: Unknown column 'status' in 'field list'<br>mysql error code: 1054[root@matrix:/home/admin/domain.monitor]

Also I would like to know what proper settings would be for:

// 0 = disabled
$__cpu_warning = 1;
$__cpu_suspend = 0;

// 0 = disabled
$__proc_warning = 1;
$__proc_suspend = 0;

Just pick any number I want or what?
 
XBL said:
@ RayManZ: You set the 'zero' to the actual suspend limit (is kind of confusing, I had to read it from monitor.php).

@ Everyone: I made a small script to monitor the database. Current functions:
  • Order by:
  • Domain
  • CPU Usage
  • Processes
  • Descending and Ascending
  • Search by domain
Any ideas on what to add are very welcome (e-mail (jochem at vuilnisbak dot com) or PM).

Download: domainmonitor.php
Test: domainmonitor/.
Username: admin
Password: password

The stats are live from the database.

[edit]I also recommend to set the $__url_source (in conf/configure.php) to http://localhost/server-status (replace server-status with whatever you're using). And change
Code:
ExtendedStatus On
<Location /server-status>
        SetHandler server-status
</Location>
To
Code:
ExtendedStatus On
<Location /server-status>
        SetHandler server-status
        Order deny,allow
        Deny from all
        Allow from localhost
</Location>
Security before everything ;).[/edit]

Jochem


i get error
Code:
Warning: array_sum(): The argument should be an array in /home/admin/domains/******.***/public_html/server-status/domainmonitor.php on line 116

Warning: Division by zero in /home/admin/domains/******.***/public_html/server-status/domainmonitor.php on line 117

Warning: array_sum(): The argument should be an array in /home/admin/domains/******.***/public_html/server-status/domainmonitor.php on line 118

Warning: Division by zero in /home/admin/domains/******.***/public_html/server-status/domainmonitor.php on line 119
 
FYI this :

ExtendedStatus On
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from localhost
</Location>


Doesn't work for me. I have to put :

ExtendedStatus On
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from IP ADRESS
</Location>
 
maybe lol, but i have no problem with localhost in my php/mysql script ^^
 
Ok have this working fine. Only question really is does this script require the actual "admin" user account pass or will it be fine if setup on it's own admin level account (which is what i had done).
 
@how@ said:
i get error
Code:
Warning: array_sum(): The argument should be an array in /home/admin/domains/******.***/public_html/server-status/domainmonitor.php on line 116

Warning: Division by zero in /home/admin/domains/******.***/public_html/server-status/domainmonitor.php on line 117

Warning: array_sum(): The argument should be an array in /home/admin/domains/******.***/public_html/server-status/domainmonitor.php on line 118

Warning: Division by zero in /home/admin/domains/******.***/public_html/server-status/domainmonitor.php on line 119


I have same error!! Why?? i Change info on httpd.conf
 
Re: Help!!!!

chatwizrd said:
I have some bug or something...

[root@matrix:/home/admin/domain.monitor] php monitor.php
fatal error: UPDATE cpu_monitor SET status='warned' WHERE domain='games******.net'<p>mysql error: Unknown column 'status' in 'field list'<br>mysql error code: 1054[root@matrix:/home/admin/domain.monitor]

Try the following to make the table.. or just add the status field to your existing table.
PHP:
CREATE TABLE cpu_monitor (
  domain varchar(70) NOT NULL default '',
  status varchar(10) NOT NULL default '',
  cpu_x1 float(4,2) NOT NULL default '0.00',
  cpu_x2 float(4,2) NOT NULL default '0.00',
  cpu_x3 float(4,2) NOT NULL default '0.00',
  processes_x1 float(4,2) NOT NULL default '0.00',
  processes_x2 float(4,2) NOT NULL default '0.00',
  processes_x3 float(4,2) NOT NULL default '0.00',
  PRIMARY KEY  (domain)
) TYPE=MyISAM;
Also I would like to know what proper settings would be for:

// 0 = disabled
$__cpu_warning = 1;
$__cpu_suspend = 0;

// 0 = disabled
$__proc_warning = 1;
$__proc_suspend = 0;

Just pick any number I want or what?
I wouldn't set the __proc values too low or the script will send out emails for trivial reasons. I don't know what reasonable numbers should be for the processes, best to look at the database and see what looks 'normal'.

The CPU though I am assuming that it's a 0-100% scale so a simple way to figure it would be to divide 100 by the number of sites hosted -- then probably add a little to that number for the suspended value.

There is also an 'ignore' portion in the monitor.php worth using maybe. It appears to be useful for opting-out your own main site.
 
cant get it working
Warning: opendir(/usr/local/directadmin/data/users): failed to open dir: Permission denied in /home/admin/domains/webpriser.info/public_html/server-status/lib/directadmin.php on line 36

Warning: readdir(): supplied argument is not a valid Directory resource in /home/admin/domains/webpriser.info/public_html/server-status/lib/directadmin.php on line 37

Warning: closedir(): supplied argument is not a valid Directory resource in /home/admin/domains/webpriser.info/public_html/server-status/lib/directadmin.php on line 70

i got this all over the site.
please advice
 
The user which executes the script (probably 'apache') appears not to be allowed to read /usr/local/directadmin/data/users. You have to make sure apache can read the directory.

Jochem
 
XBL said:
The user which executes the script (probably 'apache') appears not to be allowed to read /usr/local/directadmin/data/users. You have to make sure apache can read the directory.

Jochem
no kidding?
how without blocking DA access to thoose files
 
Lots of ways; read a good book on linux administration.

The only reason I'm not explaining in detail is because I believe it to be a system security issue.

Jeff
 
I want to know the configure.php file have this

server_type = 'DirectAdmin'

What's mean of server_type? Is it no need to change 'DirectAdmin'?

And I want to know what's go to be next after I use
./php monitor.php

I get this result

Warning: file_get_contents(): HTTP request failed! HTTP/1.1 403 Forbidden
in /home/admin/domains/domainname/public_html/server-status/monitor.php on line 23

Warning: file_get_contents(http://www.domainname/server-status): failed to open stream: Success in /home/admin/domains/domainanme/public_html/server-status/monitor.php on line 23
Table updated.

Is it right? I have no idea on it
 
Status
Not open for further replies.
Back
Top