Check health of my server

Discussion in 'Linux Beginners' started by pecka33, Mar 30, 2022.

  1. pecka33

    pecka33 Member

    Hello,

    is here anybody who has tips how to check health of my server? I have installed debian 11 with lastes ispconfig, apache, db, emails etc. for websites. All working fine, no errors in error logs etc., only warnings.
    Have you any tips how could i check if all working fine, that there are no security problems etc.? For example how can i found package which i dont need/not using?

    Thank you.
     
  2. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    you can check processes / services are running fine with 'top'.
    if you installed from a server .iso, it should only install the minimum you need, unless you tell it otherwise, and then it'll install whats needed for whatever you decide to add post-install, eg apache, mysql etc. if you remove something, or an update means a particular package is no longer required, it'll let you know the next time you try to update, and tell you how it let it auto-remove unneeded packages.

    if you want to know everything's working properly, and continues to work properly, and get alerts, or have it try to fix itself if something goes wrong, install and configure monitoring software, eg munin, monit, nagios, icinga or any one of the multitude others.
    check the logs manually daily, or (especially for multiple servers), get all the logs into one place and have a system to search them, rsyslog, elasticsearch (ELK stack) etc.

    for security, install and configure firewalls. at the edge of your network, and on every server. only open the required ports for that server.
    install ip logging / banning software, eg fail2ban. install file/system checking software eg rkhunter lynis clamav maldet etc..
     
    Anmol likes this.
  3. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    What @nhybgtvfr wrote. In addition, I suggest installing and configuring logwatch. Make it send summary of logs to your e-mail.
    Debian has package popularity-contest, which has command popcon-largest-unused. I have not used it, but maybe it suits your needs? I assume it works even if you do not send the usage data to the popcon project.
    Debian Release Notes for Bullseye have info on obsolete packages and how to remove unneeded packages and files. https://www.debian.org/releases/stable/releasenotes
     
  4. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    I always go with monitoring software monit. Easier to config and maintain so far, plus most services can be minitored and fixed automatically if anything is wrong.

    For Debian or Ubuntu minimal install ensure nothing unnecessary is in your server. However if you are a very advanced user, you can also restore only the minimal software with aptitude but quite dangerous so do not attempt to do this if you are not.

    For security, other than what were mentioned by @nhybgtvfr, your access / login behaviour must be right i.e. keep and use very good and safe keys / passwords.
     
    Anmol likes this.
  5. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Just remembered to recommend installing lm-sensors and hddtemp, they monitor hardware "health" of your server.
     
    ahrasis likes this.
  6. pecka33

    pecka33 Member

  7. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    That should basically still work. There is also one other old monit munin tutorial as well. Open new thread if you have problem(s) in setting up and configuring your monit.
     
  8. Martingray

    Martingray New Member

    You can set up any of the popular server health monitoring tools. These tools often tell you the reason behind the warnings, and thus, you can work out a solution if you want to see all green on the graphs. In my experience, you need to keep an eye on these things.

    1) Swapping, If this is high, check for the process consuming an abnormally large memory volume.
    2) Run Queue: if there are several processes or tasks queued at all times, maybe you need to check for processes that are taking too long or consuming too many resources. Alternatively, you can also look into upgrading your server specifications.
    3)CPU usage: no process should hog the CPU (or RAM)
    4) Disk I/O: If disk I/O is high, you should check the cache process or the database hit counters.
     
    Anmol likes this.

Share This Page