Install uptime-kuma server monitoring panel on Linux system

1. Introduction to uptime-kuma

1.1 Introduction to uptime-kuma

uptime-kuma is an open source, multi-functional server monitoring panel.

1.2 uptime-kuma features

  • Monitor HTTP(s) / TCP / HTTP(s) Keywords / HTTP(s) Json Query / Ping / DNS Records / Push / Steam Game Server / Docker Container Uptime
  • Beautiful, responsive, fast UI/UX
  • Send notifications via Telegram, Discord, Gotify, Slack, Pushover, Email (SMTP) and 90+ notification services, click here to see the full list
  • 20 seconds interval
  • multilingual
  • Multiple status pages
  • Map status page to specific domain
  • Flat map
  • Certificate information
  • Agent support
  • 2FA support

2. Introduction to the practical environment

2.1 Environmental planning

This practice is a personal test environment, using the server Huawei Cloud ECS cloud server, and
the operating system version is centos7.6.

hostname IP address Operating system version Kernel version node.js version Server category
- - centos 7.6 3.10.0-957.el7.x86_64 v16.17.0 Huawei Cloud ECS cloud server

2.2 Introduction to this practice

1. The deployment environment for this practice is a personal test environment;
2. Deploy the uptime-kuma server monitoring panel in the centos7.6 environment.

2.3 Environmental requirements

  • System Requirements

✅ Major Linux distros such as Debian, Ubuntu, CentOS, Fedora and ArchLinux etc.
✅ Windows 10 (x64), Windows Server 2012 R2 (x64) or higher
❌ Replit / Heroku

  • node.js and npm version requirements
    Node.js 14/16/18/20.4
    npm >= 7

3. Check the local environment

3.1 Check local operating system version

Check local operating system version

[root@ecs-52b7 ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)

3.2 Check the system kernel version

Check system kernel version

[root@ecs-52b7 ~]#  uname -r
3.10.0-1160.92.1.el7.x86_64

3.3 Check whether Node.js is installed on the system

Check whether Node.js is installed on the system

[root@ecs-52b7 ~]# node -v
-bash: node: command not found

4. Deploy Node.js environment

4.1 Download the Node.js installation package

Download the Node.js installation package

wget https://nodejs.org/dist/v16.17.0/node-v16.17.0-linux-x64.tar.xz

4.2 Unzip the Node.js installation package

Unzip the Node.js installation package

tar -xvJf node-v16.17.0-linux-x64.tar.xz

Insert image description here

4.3 Copy binary files

Copy the binary files under /root/node-v16.17.0-linux-x64/bin/ to /usr/local/bin

cp -a /root/node-v16.17.0-linux-x64/bin/node /usr/local/bin/node
cp -a /root/node-v16.17.0-linux-x64/bin/npm /usr/local/bin/npm

4.4 Configure environment variables

  • In the /etc/profile file, add the following two lines:
export NODE_HOME=/root/node-v16.17.0-linux-x64/bin/
export PATH=$PATH:$NODE_HOME:/usr/local/bin/

  • Make the variable effective
source /etc/profile

4.5 Check node version

View node version

[root@ecs-52b7 ~]# npm -v
8.15.0
[root@ecs-52b7 ~]# node -v
v16.17.0

5. Install uptime-kuma

5.1 Download uptime-kuma source code package

  • Download uptime-kuma source code package
git clone https://github.com/louislam/uptime-kuma.git
  • View the uptime-kuma source package
[root@ecs-52b7 uptime-kuma]# tree -L 2 ./
./
├── babel.config.js
├── CNAME
├── CODE_OF_CONDUCT.md
├── config
│   ├── cypress.config.js
│   ├── cypress.frontend.config.js
│   ├── jest-backend.config.js
│   └── vite.config.js
├── CONTRIBUTING.md
├── db
│   ├── kuma.db
│   ├── patch10.sql
│   ├── patch1.sql
│   ├── patch-2fa-invalidate-used-token.sql
│   ├── patch-2fa.sql
│   ├── patch2.sql
│   ├── patch3.sql
│   ├── patch4.sql
│   ├── patch5.sql
│   ├── patch6.sql
│   ├── patch7.sql
│   ├── patch8.sql
│   ├── patch9.sql
│   ├── patch-add-certificate-expiry-status-page.sql
│   ├── patch-add-clickable-status-page-link.sql
│   ├── patch-add-description-monitor.sql
│   ├── patch-add-docker-columns.sql
│   ├── patch-added-json-query.sql
│   ├── patch-added-kafka-producer.sql
│   ├── patch-added-mqtt-monitor.sql
│   ├── patch-add-gamedig-given-port.sql
│   ├── patch-add-gamedig-monitor.sql
│   ├── patch-add-google-analytics-status-page-tag.sql
│   ├── patch-add-invert-keyword.sql
│   ├── patch-add-other-auth.sql
│   ├── patch-add-parent-monitor.sql
│   ├── patch-add-radius-monitor.sql
│   ├── patch-add-retry-interval-monitor.sql
│   ├── patch-add-sqlserver-monitor.sql
│   ├── patch-add-timeout-monitor.sql
│   ├── patch-api-key-table.sql
│   ├── patch-group-table.sql
│   ├── patch-grpc-monitor.sql
│   ├── patch-http-body-encoding.sql
│   ├── patch-http-monitor-method-body-and-headers.sql
│   ├── patch-improve-performance.sql
│   ├── patch-incident-table.sql
│   ├── patch-maintenance-cron.sql
│   ├── patch-maintenance-table2.sql
│   ├── patch-monitor-add-resend-interval.sql
│   ├── patch-monitor-basic-auth.sql
│   ├── patch-monitor-expiry-notification.sql
│   ├── patch-monitor-oauth-cc.sql
│   ├── patch-monitor-push_token.sql
│   ├── patch-monitor-tls.sql
│   ├── patch-notification_sent_history.sql
│   ├── patch-ping-packet-size.sql
│   ├── patch-proxy.sql
│   ├── patch-setting-value-type.sql
│   ├── patch-status-page-footer-css.sql
│   └── patch-status-page.sql
├── docker
│   ├── alpine-base.dockerfile
│   ├── builder-go.dockerfile
│   ├── debian-base.dockerfile
│   ├── docker-compose.yml
│   ├── dockerfile
│   ├── dockerfile-alpine
│   └── etc
├── ecosystem.config.js
├── extra
│   ├── beta
│   ├── build-healthcheck.js
│   ├── checkout-pr.js
│   ├── close-incorrect-issue.js
│   ├── compile-install-script.ps1
│   ├── deploy-demo-server.js
│   ├── download-dist.js
│   ├── entrypoint.sh
│   ├── env2arg.js
│   ├── exe-builder
│   ├── fs-rmSync.js
│   ├── healthcheck.go
│   ├── healthcheck.js
│   ├── install.batsh
│   ├── mark-as-nightly.js
│   ├── press-any-key.js
│   ├── remove-2fa.js
│   ├── reset-password.js
│   ├── simple-dns-server.js
│   ├── simple-mqtt-server.js
│   ├── sort-contributors.js
│   ├── test-docker.js
│   ├── update-language-files
│   ├── update-version.js
│   ├── update-wiki-version.js
│   └── upload-github-release-asset.sh
├── index.html
├── install.sh
├── LICENSE
├── package.json
├── package-lock.json
├── public
│   ├── apple-touch-icon.png
│   ├── apple-touch-icon-precomposed.png
│   ├── favicon.ico
│   ├── icon-192x192.png
│   ├── icon-512x512.png
│   ├── icon.png
│   ├── icon.svg
│   └── manifest.json
├── README.md
├── SECURITY.md
├── server
│   ├── 2fa.js
│   ├── auth.js
│   ├── cacheable-dns-http-agent.js
│   ├── check-version.js
│   ├── client.js
│   ├── config.js
│   ├── database.js
│   ├── docker.js
│   ├── google-analytics.js
│   ├── image-data-uri.js
│   ├── jobs
│   ├── jobs.js
│   ├── model
│   ├── modules
│   ├── monitor-types
│   ├── notification.js
│   ├── notification-providers
│   ├── password-hash.js
│   ├── prometheus.js
│   ├── proxy.js
│   ├── rate-limiter.js
│   ├── routers
│   ├── server.js
│   ├── settings.js
│   ├── socket-handlers
│   ├── uptime-cache-list.js
│   ├── uptime-kuma-server.js
│   └── util-server.js
├── src
│   ├── App.vue
│   ├── assets
│   ├── components
│   ├── i18n.js
│   ├── icon.js
│   ├── lang
│   ├── layouts
│   ├── main.js
│   ├── mixins
│   ├── modules
│   ├── pages
│   ├── router.js
│   ├── util-frontend.js
│   ├── util.js
│   └── util.ts
├── test
│   ├── backend.spec.js
│   ├── cypress
│   ├── prepare-test-server.js
│   ├── test_install_script
│   └── test-radius.dockerfile
└── tsconfig.json

28 directories, 137 files

5.3 Set npm mirror source

  • npm sets domestic Taobao mirror source
npm config set registry https://registry.npmmirror.com
  • View npm mirror source
[root@jeven uptime-kuma]# npm get registry
https://registry.npmmirror.com/

5.4 Install uptime-kuma

  • Prepare project environment
npm run setup

Insert image description here

  • Execute the following command
node server/server.js &

Insert image description here

  • Install pm2
npm install pm2 -g && pm2 install pm2-logrotate

Insert image description here

  • Start uptime-kuma service
pm2 start server/server.js --name uptime-kuma

Insert image description here

5.5 Check uptime-kuma service status

  • Check uptime-kuma service status
[root@ecs-52b7 uptime-kuma]# ss -tunlp |grep 300
tcp    LISTEN     0      511    [::]:3001               [::]:*                   users:(("node",pid=2209,fd=24))

6. Basic use of uptime-kuma

6.1 Create an administrator account

Access address: IP:3001
. Replace the IP address with your own server IP address. The cloud server security group needs to allow port 3001 and turn off the firewall and selinux.
Insert image description here

Insert image description here

6.2 Add monitoring items

Check whether the local 3001 port is listening, fill in the basic information of the following monitoring items, and save it.

Insert image description here

Insert image description here

Guess you like

Origin blog.csdn.net/jks212454/article/details/132956756