Server Statistics not displayed in CSF

CAISC

Verified User
Joined
Dec 2, 2021
Messages
87
Location
SSH Terminal
Hi,

Post installation of Direct Admin CSF was automatically installed, its running fine.
But I have noticed its not showing the button for System Statistics

Not sure its because Direct Admin does not support it or some required modules are missing.
Are there some additional changes to be done to enable System Statistics in CSF firewall?

Under CSF Statistics Settings I have enabled -
ST_ENABLE = ON
ST_SYSTEM = ON
ST_MYSQL = ON
ST_LOOKUP = ON

Thanks
 
In order for the statistics to be generated, the dependencies must first be installed:
Code:
yum install perl-libwww-perl.noarch perl-LWP-Protocol-https.noarch perl-GDGraph
 
I use CXS Scanner also, to install it there is a prerequisite to install -

yum install perl-libwww-perl.noarch perl-LWP-Protocol-https.noarch perl-Archive-Tar.noarch perl-Archive-Zip.noarch perl-Linux-Inotify2 perl-Compress-Zlib sqlite perl-DBI perl-DBD-SQLite perl-IO-Socket-SSL.noarch perl-Net-SSLeay.x86_64 sqlite

So its already there.

Installed perl-GDGraph

Now see the button. Thanks @apogee

Stats is not able to gather disk, apache and mysql data -

lfd[861511]: STATS: Unable to retrieve Apache Server Status [http://127.0.0.1/server-status?auto] - Unable to download: Unauthorized
lfd[882994]: STATS: 15 sec. timeout performing ST_MYSQL
 
Last edited:
/etc/httpd/conf/extra/httpd-info.conf

file says -

<Location /server-status>
SetHandler server-status
AuthType basic
AuthName "Apache status"
AuthUserFile /var/www/html/passwd-server-status
Require valid-user
</Location>

currently when rewriting conf, a username and password is auto generated to see server-status page on localhost.
Not sure how to pass it in CSF.
 
Ah that is probably the new one. I still use old one because I used the custom setup.
There is indeed a passwd-server-status in the /var/www/html directory, but I don't know which password is used there, maybe somebody can enlighten us.

However if you want, you can choose to use a custom one. You have to create this/these directory('s):
/usr/local/directadmin/custombuild/custom/ap2/conf/extra/
so the custom the ap2 etc. and then copy the httpd-info in there and remove that authentication stuff, or use the one I still use which is this:

Code:
<Location /server-status>
    SetHandler server-status
#    Require host .example.com
    Require ip 127
    Require ip 84.xx.xx.xx
</Location>

#
# ExtendedStatus controls whether Apache will generate "full" status
# information (ExtendedStatus On) or just basic information (ExtendedStatus
# Off) when the "server-status" handler is called. The default is Off.
#
ExtendedStatus On

#
# Allow remote server configuration reports, with the URL of
#  http://servername/server-info (requires that mod_info.c be loaded).
# Change the ".example.com" to match your domain to enable.
#
<Location /server-info>
    SetHandler server-info
#    Require host .example.com
    Require ip 127
    Require ip 84.xx.xx.xx
</Location>

Then you can rebuild the confs and this httpd-info.conf should also be present in the /etc/httpd/conf/extra directory.
This way CSF should be able to access the server-status page without any password.

However, be aware that I did not test this with CSF myself.
Just tested this... it's working.
 
Last edited:
Hi,

Seems caused from latest update , I have the same problem :

Server with similar error :
[root@ns4 domains]# /usr/local/directadmin/directadmin v
Version: DirectAdmin v.1.63.4
[root@ns4 domains]# httpd -v
Server version: Apache/2.4.51 (Unix)
Server built: Dec 31 2021 00:00:40
[root@ns4 domains]#
[root@ns4 domains]# cat /etc/httpd/conf/extra/httpd-info.conf
#
# Get information about the requests being processed by the server
# and the configuration of the server.
#
# Required modules: mod_authz_core, mod_authz_host,
# mod_info (for the server-info handler),
# mod_status (for the server-status handler)

#
# Allow server status reports generated by mod_status,
# with the URL of http://servername/server-status
# Change the ".example.com" to match your domain to enable.

<Location /server-status>
SetHandler server-status
AuthType basic
AuthName "Apache status"
AuthUserFile /var/www/html/passwd-server-status
Require valid-user
</Location>

#
# ExtendedStatus controls whether Apache will generate "full" status
# information (ExtendedStatus On) or just basic information (ExtendedStatus
# Off) when the "server-status" handler is called. The default is Off.
#
ExtendedStatus On

#
# Allow remote server configuration reports, with the URL of
# http://servername/server-info (requires that mod_info.c be loaded).
# Change the ".example.com" to match your domain to enable.
#
<Location /server-info>
SetHandler server-info
AuthType basic
AuthName "Apache status"
AuthUserFile /var/www/html/passwd-server-status
Require valid-user
</Location>
#Authenticate using:


Working :
[root@ns1 ~]# /usr/local/directadmin/directadmin v
Version: DirectAdmin v.1.63.1
[root@ns1 ~]# httpd -v
Server version: Apache/2.4.51 (Unix)
Server built: Dec 29 2021 03:01:11
[root@ns1 ~]#
[root@ns1 ~]# cat /etc/httpd/conf/extra/httpd-info.conf
#
# Get information about the requests being processed by the server
# and the configuration of the server.
#
# Required modules: mod_authz_core, mod_authz_host,
# mod_info (for the server-info handler),
# mod_status (for the server-status handler)

#
# Allow server status reports generated by mod_status,
# with the URL of http://servername/server-status
# Change the ".example.com" to match your domain to enable.

<Location /server-status>
SetHandler server-status
Require host .example.com
Require ip 127
</Location>

#
# ExtendedStatus controls whether Apache will generate "full" status
# information (ExtendedStatus On) or just basic information (ExtendedStatus
# Off) when the "server-status" handler is called. The default is Off.
#
#ExtendedStatus On

#
# Allow remote server configuration reports, with the URL of
# http://servername/server-info (requires that mod_info.c be loaded).
# Change the ".example.com" to match your domain to enable.
#
<Location /server-info>
SetHandler server-info
Require host .example.com
Require ip 127
</Location>
#Authenticate using:
 
Latest update allows to view server status, that's much needed feature similar to cpanel Apache status.
As Richard mentioned there is alternate way to get that running with CSF.
 
I have set ST_MYSQL = ON
but still mySQL data is not showing in stats.

mysql root use password is specified in conf file. Any idea how to make it work.
 
I just tried and it works at my system.
However, i used the da_admin user with it's password.
And ofcourse restarted csf and lfd.

It did not show graphs yet, because that takes a couple of minutes before you see the line starting to show.
Now it shows a little bit.

Try if your pass is correct like this in SSH first:
mysql -u da_admin -p
or use root as user. It will ask the password. If it's oke you will get the mysql prompt which you can quit.
 
Cross check root user login -
mysql -u root -p
Its working fine in SSH.

but same credentials when specified in CSF dont show graph.
 
Odd. Same thing if you try the da_admin user then I guess. But you might just try, to be sure.

Doesn't it show any graphs, are all graphs just blank?
Or do you get an error when you select a mysql graph?
 
If you see the graphs it should work. I don't know where CSF is reading the data from, but maybe the statistics table in mysql is missing or something like that?
Because if the graphs are shown, then the connection with mysql is made. And you also tested this OK.

You could try with the da_admin credentials just to be sure. Should give already a very short line within a couple of minutes. If that does not work either, it must be something with mysql imho.
 
Back
Top