Rework Dirs
This commit is contained in:
93
Monitoring & Logging/Grafana/Install-Grafana-Prometheus.md
Normal file
93
Monitoring & Logging/Grafana/Install-Grafana-Prometheus.md
Normal file
@@ -0,0 +1,93 @@
|
||||
# Installing Grafana Prometheus
|
||||
|
||||
# Installing Grafana on Ubuntu with apt
|
||||
|
||||
Installing Grafana on Ubuntu is a relatively simple process. The following steps will guide you through the installation process.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before you begin, you will need to have a working Ubuntu system with apt installed.
|
||||
|
||||
## Step 1: Add the Grafana repository
|
||||
|
||||
Add the Grafana repository to your system by running the following command:
|
||||
|
||||
```
|
||||
sudo apt-get install apt-transport-https
|
||||
sudo apt-get install software-properties-common wget
|
||||
wget -q -O - <https://packages.grafana.com/gpg.key> | sudo apt-key add -
|
||||
sudo add-apt-repository "deb <https://packages.grafana.com/oss/deb> stable main"
|
||||
|
||||
```
|
||||
|
||||
## Step 2: Install Grafana
|
||||
|
||||
Once the repository is added, you can install Grafana with the following command:
|
||||
|
||||
```
|
||||
sudo apt-get update
|
||||
sudo apt-get install grafana
|
||||
|
||||
```
|
||||
|
||||
## Step 3: Start Grafana
|
||||
|
||||
Once the installation is complete, start the Grafana server with the following command:
|
||||
|
||||
```
|
||||
sudo service grafana-server start
|
||||
|
||||
```
|
||||
|
||||
## Step 4: Access the Grafana Dashboard
|
||||
|
||||
Once the server is started, you can access the Grafana dashboard by browsing to [http://localhost:3000](http://localhost:3000/) in your web browser. The default username and password are both `admin`.
|
||||
|
||||
## Conclusion
|
||||
|
||||
You have now successfully installed Grafana on your Ubuntu system using apt. You can now start using Grafana to monitor and visualize your data.
|
||||
|
||||
# Installing Prometheus on Ubuntu
|
||||
|
||||
Installing Prometheus on Ubuntu is a relatively simple process. The following steps will guide you through the installation process.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before you begin, you will need to have a working Ubuntu system with apt installed.
|
||||
|
||||
## Step 1: Add the Prometheus repository
|
||||
|
||||
Add the Prometheus repository to your system by running the following command:
|
||||
|
||||
```
|
||||
sudo apt-get install apt-transport-https
|
||||
echo "deb <https://packages.grafana.com/oss/deb> stable main" | sudo tee -a /etc/apt/sources.list.d/prometheus.list
|
||||
|
||||
```
|
||||
|
||||
## Step 2: Install Prometheus
|
||||
|
||||
Once the repository is added, you can install Prometheus with the following command:
|
||||
|
||||
```
|
||||
sudo apt-get update
|
||||
sudo apt-get install prometheus
|
||||
|
||||
```
|
||||
|
||||
## Step 3: Start Prometheus
|
||||
|
||||
Once the installation is complete, start the Prometheus server with the following command:
|
||||
|
||||
```
|
||||
sudo service prometheus start
|
||||
|
||||
```
|
||||
|
||||
## Step 4: Access the Prometheus Dashboard
|
||||
|
||||
Once the server is started, you can access the Prometheus dashboard by browsing to [http://localhost:9090](http://localhost:9090/) in your web browser.
|
||||
|
||||
## Conclusion
|
||||
|
||||
You have now successfully installed Prometheus on your Ubuntu system using apt. You can now start using Prometheus to monitor and visualize your data.
|
||||
70
Monitoring & Logging/Grafana/Install-Inflx.md
Normal file
70
Monitoring & Logging/Grafana/Install-Inflx.md
Normal file
@@ -0,0 +1,70 @@
|
||||
# Install Influx And SNMP
|
||||
|
||||
## Installing Influx On Ubuntu
|
||||
|
||||
Influx is an open source time series database that can be used to store and analyze time series data. It is written in Go and runs on Linux, macOS, and Windows machines. Installing Influx on Ubuntu is a straightforward process.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
Before you install Influx, you must make sure you have the following prerequisites:
|
||||
|
||||
- A supported version of Ubuntu, such as Ubuntu 18.04 or later
|
||||
- A working internet connection
|
||||
- A user account with sudo privileges
|
||||
|
||||
### Downloading Influx
|
||||
|
||||
To download Influx, open a terminal window and use the following command:
|
||||
|
||||
```
|
||||
wget <https://dl.influxdata.com/influxdb/releases/influxdb_1.8.2_amd64.deb>
|
||||
|
||||
```
|
||||
|
||||
### Installing Influx
|
||||
|
||||
Now that you have downloaded the Influx package, you can install it with these commands:
|
||||
|
||||
```
|
||||
sudo dpkg -i influxdb_1.8.2_amd64.deb
|
||||
sudo systemctl enable influxdb
|
||||
sudo systemctl start influxdb
|
||||
|
||||
```
|
||||
|
||||
### Testing Influx
|
||||
|
||||
You can test that Influx is working properly by running the following command:
|
||||
|
||||
```
|
||||
curl -G <http://localhost:8086/query> --data-urlencode "q=SHOW DATABASES"
|
||||
|
||||
```
|
||||
|
||||
The output should look like this:
|
||||
|
||||
```
|
||||
{
|
||||
"results": [
|
||||
{
|
||||
"statement_id": 0,
|
||||
"series": [
|
||||
{
|
||||
"name": "databases",
|
||||
"columns": [
|
||||
"name"
|
||||
],
|
||||
"values": [
|
||||
[
|
||||
"_internal"
|
||||
]
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
If you get this output, then you have successfully installed Influx on your Ubuntu machine.
|
||||
17
Monitoring & Logging/Grafana/introduction.md
Normal file
17
Monitoring & Logging/Grafana/introduction.md
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
# Grafana
|
||||
|
||||
Grafana is an open source analytics and monitoring platform designed to help users visualize, analyze, and explore their data. It is used to create beautiful and interactive dashboards, as well as to monitor and alert users to changes in their data. Grafana supports a wide variety of data sources, including Prometheus, MySQL, Postgres, and InfluxDB. It is highly customizable, allowing users to create custom dashboards and alerting rules. Grafana is easy to use and can be easily integrated with other tools and services. It is also highly secure, with authentication and authorization features to ensure data is only visible to authorized users. Grafana is used by businesses and organizations of all sizes, from small startups to large enterprises.
|
||||
|
||||
## What is Prometheus?
|
||||
|
||||
Prometheus is an open source monitoring system and time-series database. It is used for collecting metrics from various sources, such as servers, containers, and services. Prometheus provides a wide range of features, including alerting, graphing, and visualization. It is designed to be highly reliable, scalable, and easy to use. Prometheus can be used to monitor applications and services, as well as infrastructure, such as servers, containers, and networks. It is also highly extensible, allowing users to add custom metrics and dashboards. Prometheus is used by businesses and organizations of all sizes, from small startups to large enterprises.
|
||||
|
||||
## What is SNMP Protocol?
|
||||
|
||||
Simple Network Management Protocol (SNMP) is an Internet-standard protocol for managing devices on IP networks. It allows network administrators to query devices for various information and to modify certain settings within the devices. SNMP is widely used for network monitoring, network management, performance monitoring, and configuration management. It is typically used in large networks to keep track of all the devices connected to the network, such as routers, switches, and servers. SNMP is designed to provide a common way for network devices to communicate and exchange information with network management systems. SNMP is a lightweight protocol, making it ideal for small networks and low-bandwidth devices. It has a wide range of features, including the ability to configure devices remotely, monitor performance metrics, and monitor network connections. SNMP is also secure, with authentication and encryption features to ensure that data is only visible to authorized users.
|
||||
|
||||
## What is InfluxDB?
|
||||
|
||||
InfluxDB is an open source time-series database. It is designed to store and process large amounts of time-series data, such as application metrics, system metrics, and sensor data. InfluxDB is highly scalable and can easily store and process millions of data points per second. It is also easy to use, with a simple SQL-like query language and support for a wide variety of data sources. InfluxDB is highly secure, with authentication and authorization features to ensure that data is only visible to authorized users. It is used by businesses and organizations of all sizes, from small startups to large enterprises.
|
||||
|
||||
252
Monitoring & Logging/Librenms/librenms.wiki
Normal file
252
Monitoring & Logging/Librenms/librenms.wiki
Normal file
@@ -0,0 +1,252 @@
|
||||
== مرحله اول: وب سرور لینوکسی ==
|
||||
|
||||
لایبر اناماس (به انگلیسی: LibreNMS) یک سیستم نظارت بر شبکه مبتنی بر PHP/MySQL است که از Observium جعبه شده است. LibreNMS با هدف استفاده آسان، استقرار بدون درد و پشتیبانی از نظارت بر طیف گستردهای از دستگاهها انجام شده است. مجوز Observium در ماه مه 2012 به مجوز QPL تغییر یافته تغییر یافت و اخیراً به نسخههای رایگان و تجاری تقسیم شد.هدف ما با LibreNMS استمرار ایجاد NMS قابل استفاده است. برای نصب این سرویس نیاز به وبسرویس لینوکسی داریم. من در این مقاله از Ngnix استفاده میکنم.
|
||||
|
||||
|
||||
'''برخی از وبسرویس های لینوکسی:'''
|
||||
|
||||
[https://www.nginx.com Nginx]
|
||||
|
||||
[https://www.apachefriends.org/ Xampp]
|
||||
|
||||
[https://www.apache.org/ Apache]
|
||||
|
||||
[https://www.litespeedtech.com/ LiteSpeed]
|
||||
|
||||
|
||||
|
||||
قبل از شروع دقت داشته باشید که این روش فقط روی '''Ubuntu 22.04''' تست شده است.
|
||||
|
||||
برای نصب Ngnix دستورهای زیر را در '''Terminal''' اجرا کنید.
|
||||
|
||||
<code>
|
||||
sudo apt install nginx</code>
|
||||
|
||||
''' نکته: ''' اگر فایروال (ufw) روی سیستم شما نصب نباشد می توانید از مرحله بگذرید.
|
||||
|
||||
'''نکته:''' می توانید با دستور <code>sudo ufw disable</code> فایروال را غیرفعال کنید و از این مرحله بگذرید '''(امنیت سیستم شما با این روش به خطر خواهد افتاد)'''
|
||||
|
||||
<p style="background-color: #fff18a; padding: 20px;">
|
||||
''' نکته: ''' با استفاده از <code>gufw</code> می توانید تنظیمات فایروال را با محیط گرافیکی انجام دهید
|
||||
<br>
|
||||
gufw با دستور <code>sudo apt install gufw</code> نصب میشود
|
||||
</p>
|
||||
|
||||
قبل از تست کردن Nginx باید فایروال را تنظیم کنیم. در لینوکس فایروال به عنوان <code>ufw</code> ثبت میشود. با دستور زیر لیست اپلیکیشنهای فایروال به شما نمایش داده خواهد شد.
|
||||
<br>
|
||||
<code>
|
||||
sudo ufw app list
|
||||
</code>
|
||||
|
||||
اگر Ngnix به درستی نصب شده باشد خروجی دستور بالا باید شامل سه App زیر باشد.
|
||||
|
||||
<pre style="color: gray">
|
||||
Nginx Full
|
||||
Nginx HTTP
|
||||
Nginx HTTPS
|
||||
</pre>
|
||||
|
||||
با دستور زیر فایروال اجازه دسترسی به Ngnix میدهد.
|
||||
<p style="direction:ltr; text-align: right;"><code>sudo ufw allow 'Nginx Full'</code></p>
|
||||
اگر همه چیز درست تنظیم شده باشد با اجرای دستور زیر باید '''Status: Active''' باشد.
|
||||
|
||||
<code>sudo ufw status</code>
|
||||
|
||||
'''خروجی:'''
|
||||
<pre style="color: gray">
|
||||
Status: active
|
||||
|
||||
To Action From
|
||||
-- ------ ----
|
||||
OpenSSH ALLOW Anywhere
|
||||
Nginx HTTP ALLOW Anywhere
|
||||
OpenSSH (v6) ALLOW Anywhere (v6)
|
||||
Nginx HTTP (v6) ALLOW Anywhere (v6)
|
||||
</pre>
|
||||
|
||||
اگر با ''' Status: inactive''' مواجه شدید.
|
||||
|
||||
با دستور <code>sudo ufw enable</code> فایروال را فعال کنید و دوباره دستور <code>sudo ufw status</code> را اجرا کنید، تا از فعال بودن ruleهای Ngnix اطمینان پیدا کنید.
|
||||
|
||||
با دستور <code>sudo systemctl status ngnix</code>
|
||||
باید با ''' Active: Active(Running) ''' مواجه شوید.
|
||||
|
||||
<pre style="color: gray">
|
||||
nginx.service - A high performance web server and a reverse proxy server
|
||||
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset:>
|
||||
Active: active (running) since Mon 2023-09-25 15:49:44 +0330; 6min ago
|
||||
Docs: man:nginx(8)
|
||||
Process: 1033 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_proce>
|
||||
Process: 1049 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (c>
|
||||
Main PID: 1057 (nginx)
|
||||
Tasks: 17 (limit: 18637)
|
||||
Memory: 18.6M
|
||||
CPU: 68ms
|
||||
|
||||
</pre>
|
||||
|
||||
اگر <code>localhost</code> را در قسمت URL مروگر خود وارد کنید باید با پیام Welcome to Ngnix مواجه شوید.
|
||||
|
||||
== مرحله دوم: اضافه کردن کاربر و دانلود LibreNMS ==
|
||||
با دستور زیر کاربری برای libreMNS اضافه می کنیم
|
||||
|
||||
<code>"sudo useradd librenms -d /opt/librenms -M -r -s "$(which bash)</code>
|
||||
|
||||
|
||||
|
||||
سپس با دستور <code>cd /opt</code> وارد محل نصب LibreMNS می شویم و با دستور زیر LibreMNS را دانلود می کنیم
|
||||
|
||||
<code>sudo git clone https://github.com/librenms/librenms.git</code>
|
||||
|
||||
|
||||
== مرحله سوم: دادن دسترسی ها ==
|
||||
با چهار دستور زیر دسترسی ها لازم را بدهید
|
||||
|
||||
<code>sudo chown -R librenms:librenms /opt/librenms</code>
|
||||
|
||||
<code>sudo chmod 771 /opt/librenms</code><code>sudo setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage</code><code>sudo setfacl -R -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage</code>
|
||||
|
||||
== مرحله چهارم: نصب PHP و وابستگی هایش ==
|
||||
برای اجرای LibreNMS نه تنها نیاز به سرور لینوکسی داریم بلکه به کامپایلر PHP نیز نیاز داریم. برای نصب کامپایلر PHP ابتدا باید repository آن را با دستورات زیر به apt اضافه کنیم.
|
||||
|
||||
<code>sudo apt install software-properties-common -y</code>
|
||||
|
||||
<code>sudo add-apt-repository universe</code>
|
||||
|
||||
|
||||
|
||||
سپس با دستورات زیر apt را بروز کرده و PHP و مشتقات آن را نصب میکنیم.
|
||||
|
||||
<code>sudo apt update</code>
|
||||
|
||||
<code>sudo apt install acl curl fping git graphviz imagemagick mariadb-client mariadb-server mtr-tiny nginx-full nmap php-cli php-curl php-fpm php-gd php-gmp php-json php-mbstring php-mysql php-snmp php-xml php-zip rrdtool snmp snmpd whois unzip python3-pymysql python3-dotenv python3-redis python3-setuptools python3-systemd python3-pip</code>
|
||||
|
||||
برای نصب وابستگی های PHP با دستور <code>sudo su - librenms</code> وارد یوزر که قبل تر ساختیم شوید و با اجرای دستور زیر وابستگی ها را دانلود و نصب کنید.
|
||||
|
||||
<code>scripts/composer_wrapper.php install --no-dev/.</code>
|
||||
|
||||
با دستور <code>exit</code> خارچ شوید
|
||||
|
||||
== مرحله پنجم: نصب MariaDB و ساخت دیتابیس ==
|
||||
برای نصب MariaDB از دستور زیر استفاده کنید.
|
||||
|
||||
<code>sudo apt install mariadb-server</code>
|
||||
|
||||
|
||||
|
||||
روی Ubuntu این سرویس بعد از نصب به طور خودکار اجرا خواهد شد. برای ورود به MariaDB و ساخت دیتابیس از دستور زیر استفاده کنید.
|
||||
|
||||
<code>sudo mysql</code>
|
||||
|
||||
|
||||
|
||||
با دستور زیر دیتابیسی به نام LibreMNS ساخته میشود.
|
||||
|
||||
<code>;mysql> CREATE DATABASE librenms</code>
|
||||
|
||||
|
||||
|
||||
با دو دستور زیر دسترسیهای لازم به دیتابیس داده میشود.
|
||||
|
||||
<code>;'mysql> GRANT ALL on librenms.* to librenms@localhost identified by 'yourpassword</code>
|
||||
|
||||
<code>;mysql> FLUSH PRIVILEGES</code>
|
||||
|
||||
|
||||
|
||||
'''توجه: بجای <code>yourpassword</code> رمز عبور دلخواه خود را قرار دهید.'''
|
||||
|
||||
با دستور زیر از mysql خارج میشویم.
|
||||
|
||||
<code>mysql> \q</code>
|
||||
|
||||
|
||||
|
||||
همچنین باید تغییراتی در این فایل ایجاد کنیم. برای باز کردن فایل از دستور زیر استفاده میکنیم.
|
||||
|
||||
<code>sudo gedit /etc/mysql/mariadb.conf.d/50-server.cnf</code>
|
||||
|
||||
|
||||
|
||||
بعد از باز کردن فایل، <code>[mysqld]</code> را پیدا کنید. (این Attribute برای من در خط ۹ بود) و این سه خط کد را در زیر <code>[mysqld]</code> اضافه کنید.
|
||||
|
||||
<code>innodb_file_per_table=1</code>
|
||||
|
||||
<code>lower_case_table_names=0</code>
|
||||
|
||||
|
||||
|
||||
سپس با دو دستور زیر MariaDb را Restart کنید.
|
||||
|
||||
<code>sudo systemctl enable mariadb</code>
|
||||
|
||||
<code>sudo systemctl restart mariadb</code>
|
||||
|
||||
== مرحله ششم: تنظیمات PHP-FPM ==
|
||||
با استفاده از دستور زیر Template کد PHP-FPM را کپی می کنیم
|
||||
|
||||
<code>sudo cp /etc/php/8.1/fpm/pool.d/www.conf /etc/php/8.1/fpm/pool.d/librenms.conf</code>
|
||||
|
||||
|
||||
باید تغییراتی در فایل ایجاد کنیم پس فایل را با دستور زیر باز کنید
|
||||
|
||||
<code>sudo gedit /etc/php/8.1/fpm/pool.d/librenms.conf</code>
|
||||
|
||||
|
||||
در فایل به دنبال <code>[www]</code> بگردید و آن را به <code>[librenms]</code> تغییر دهید
|
||||
|
||||
<code>user</code> و <code>group</code> را نیز مانند زیر تغییر دهید
|
||||
|
||||
<code>user = librenms</code>
|
||||
|
||||
<code>group = librenms</code>
|
||||
|
||||
|
||||
همچنین پارامتر <code>Listen</code> را نیز مانند زیر تغییر دهید
|
||||
|
||||
<code>listen = /run/php-fpm-librenms.sock</code>
|
||||
|
||||
== مرحله هفتم: تنظیمات وب سرویس ==
|
||||
با دستور <code>sudo gedit /etc/nginx/conf.d/librenms.conf</code> فایل تنظیمات وب سرویس را بسازید.
|
||||
<span style="text-align: left" lang="en" dir="ltr">server {
|
||||
listen 80;
|
||||
server_name librenms.example.com;
|
||||
root /opt/librenms/html;
|
||||
index index.php;
|
||||
|
||||
charset utf-8;
|
||||
gzip on;
|
||||
gzip_types text/css application/javascript text/javascript application/x-javascript image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon;
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
location ~ [^/]\.php(/|$) {
|
||||
fastcgi_pass unix:/run/php-fpm-librenms.sock;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
include fastcgi.conf;
|
||||
}
|
||||
location ~ /\.(?!well-known).* {
|
||||
deny all;
|
||||
}</span>
|
||||
'''توجه: <code>librenms.example.com</code>''' با آدرس سایت خود مانند <code>localhost</code> عوض کنید.
|
||||
|
||||
== مرحله هشتم: نصب گرافیکی ==
|
||||
با ورود به سایت yoursite/install ساخت حساب کاربری را انجام داده و اطلاعات دیتابیس مانند زیر وارد کنید.
|
||||
host: localhost
|
||||
username: librenms
|
||||
password: yourpassword
|
||||
|
||||
== مرحله نهم: کار با API (اختیاری) ==
|
||||
واسط برنامهنویسی نرمافزار کاربردی یا ایپیآی (به انگلیسی: API ، مخفف Application Programming Interface ) که به صورت خلاصه به آن واسط برنامهنویسی هم گفته میشود، واسط بین یک کتابخانه یا سیستمعامل و برنامههایی است که از آن تقاضای سرویس میکنند. در اینجا با استفاده از LibreNMS API می توانید هر کاری که در محیط گرافیکی نرم افزار را انجام می دهد در کد خود نیز تعبیه کنید.
|
||||
|
||||
|
||||
برای استفاده از API اول باید API CORS را روشن کنید. برای اینکار می توانید '''[http://37.152.185.153/settings/api yoursite.xxx/settings/api]''' را در مرورگر خود تایپ کنید و یا از طریق '''GlobalSetting -> API <- ⚙️''' وارد این منو شوید. سپس گزینه '''Enable CORS support for the API''' را فعال کنید.
|
||||
|
||||
|
||||
حال نیاز به API Access Token داریم برای دسترسی به این منو می توانید '''yoursite.xxx/api-access''' را در مرورگر خود تایپ کنید یا از طریق '''API -> API Settings''' '''<- ⚙️''' وارد صفحه شوید. حالا بر روی '''Create API Access Token''' کلیک کنید.
|
||||
|
||||
|
||||
'''نکته:''' برای استفاده از API باید '''API Access Token''' را با هدر '''X-Auth-Token''' ارسال کنید.
|
||||
|
||||
برای مشاهده توابع قابل استفاده به [https://docs.librenms.org/API/ Librenms API Docs] مراجعه کنید
|
||||
|
||||
BIN
Monitoring & Logging/Zabbix/Zabbix-dashboard.png
Normal file
BIN
Monitoring & Logging/Zabbix/Zabbix-dashboard.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 181 KiB |
117
Monitoring & Logging/Zabbix/doc.wiki
Normal file
117
Monitoring & Logging/Zabbix/doc.wiki
Normal file
@@ -0,0 +1,117 @@
|
||||
زبیکس یک نرمافزار متن اوپن سورس برای مانیتور شبکهها و نرمافزارها در سطح سازمانی است، که توسط الکسی ولادیشو (به انگلیسی: Alexei Vladishev) ایجاد شدهاست. این نرمافزار برای مانیتور و تشخیص وضعیت سرویسهای شبکهها، سرورها و دیگر سخت افزارهای شبکه طراحی شدهاست.
|
||||
|
||||
زبیکس از mysql، PostgreSQL، sqlite، Oracle و db2برای ذخیره دادهها پشتیبانی میکند. برنامهنویسی سمت سرور از زبان C بهره میبرد و برنامهنویسی سمت کاربری آن از زبان PHP استفاده میکند.
|
||||
|
||||
== نحوه نصب ==
|
||||
|
||||
=== نصب زبیکس ===
|
||||
|
||||
==== نصب ریپازیتوری زبیکس ====
|
||||
(توجه کامند زیر برای هر سیستم و هر ورژن متفاوته و ما از ابونتو 22 استفاده میکنیم برای دیدن کامند های دیگر از این [https://www.zabbix.com/download?zabbix=6.4&os_distribution=ubuntu_arm64&os_version=20.04&components=server_frontend_agent&db=mysql&ws=apache لینک] استفاده کنید)
|
||||
|
||||
با استفاده کامند زیر پکیج زپیکس دانلود میشود.
|
||||
|
||||
<code>wget https://repo.zabbix.com/zabbix/6.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu22.04_all.deb</code>
|
||||
|
||||
برای وریفای کردن دانلود از دستور `ls` استفاده میشود.
|
||||
|
||||
برای نصب از کامند های زیر استفاده کنید
|
||||
|
||||
<code>sudo dpkg -i zabbix-release_6.4-1+ubuntu22.04_all.deb</code>
|
||||
|
||||
<code>sudo apt update</code>
|
||||
|
||||
==== نصب زبیکس از ریپازیتوری ====
|
||||
با کامند زیر زبیکس نصب میشد
|
||||
|
||||
<code>sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent</code>
|
||||
|
||||
=== اتصال دیتابیس ===
|
||||
|
||||
==== نصب دیتابیس ====
|
||||
<code>sudo apt install mysql-server</code>
|
||||
|
||||
برای وریفای کردن دیتابیس از دستور زیر استفاده میکنیم
|
||||
|
||||
<code>sudo service mysql status</code>
|
||||
|
||||
برای ایمن کردن دیتابیس از دستور زیر استفاده کنید
|
||||
|
||||
<code>sudo mysql_secure_installation</code>
|
||||
[[پرونده:./mysql.png|تنظیمات مای اسکیول|حاشیه|وسط|بیقاب|719x719پیکسل]]
|
||||
در تصویر بالا نحوه تنظیمات دیتابیس نمایش داده شده
|
||||
|
||||
==== اتصال زبیکس به دیتابیس ====
|
||||
برای ساخت دیتابیس ابتدا دستور زیر را وارد میکنید
|
||||
|
||||
<code>sudo mysql -uroot -p</code>
|
||||
|
||||
سپس پسورد خود را وارد کنید و وارد شوید
|
||||
|
||||
بعد از ورود به دیتابیس دستورات زیر را در دیتابیس خود وارد کنید
|
||||
|
||||
<span dir="ltr" lang="en">mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
|
||||
mysql> create user zabbix@localhost identified by 'password'; -- به جای پسورد رمز مورد نظر خود را وارد کنید
|
||||
mysql> grant all privileges on zabbix.* to zabbix@localhost;
|
||||
mysql> set global log_bin_trust_function_creators = 1;
|
||||
mysql> quit;</span>
|
||||
سپس دستور زیر را وارد کنید و پسوردی که در مرحله قبلی وارد کردید را وارد کنید
|
||||
|
||||
<code>zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix</code>
|
||||
|
||||
سپس دوباره با استفاده از دستور <code>sudo mysql -uroot -p</code> مجددا وارد دیتابیس شوید و دستورات زیر را وارد کنید
|
||||
|
||||
<span dir="ltr" lang="en">mysql> set global log_bin_trust_function_creators = 0;
|
||||
mysql> quit;</span>
|
||||
با دستورات زیر فایل /etc/zabbix/zabbix_server.conf را بازکنید و در انتهای فایل <code>DBPassword=your password</code>را وارد کنید (به جای your password) پسوردای که برای زبیکس ساختید را وارد کنید
|
||||
|
||||
<span dir="ltr" lang="en">cd /etc/zabbix/</span>
|
||||
sudo apt install vim
|
||||
sudo vim zabbix_server.conf
|
||||
درنهایت با دستورات زیر زبیکس را ری استارت کنیم
|
||||
sudo systemctl restart zabbix-server zabbix-agent apache2
|
||||
sudo systemctl enable zabbix-server zabbix-agent apache2
|
||||
برای وارد شدن به زبیکس از دستور زیر استفاده کنید
|
||||
|
||||
[http://localhost/zabbix/setup.php http://localhost/zabbix/]
|
||||
|
||||
سپس گزینه next را بزنید و دوباره گزینه next را بزنید
|
||||
|
||||
در قسمت passowrd پسورد زبیکس را وارد کنیدو نکست بزنید
|
||||
|
||||
اسم سرور را به دلخواه انتخاب کنید و دوباره نکست بزنید
|
||||
|
||||
دوباره نکست بزنید تا وارد صفحه لوگین شوید
|
||||
|
||||
با یوزنیم Admin با A بزرگ و پسورد zabbix
|
||||
|
||||
=== خطاهای احتمالی ===
|
||||
|
||||
==== Locale for language "en_US" is not found on the web server. ====
|
||||
درصورت برخورد با این ارور کامند زیر را وارد کنید
|
||||
sudo dpkg-reconfigure locales
|
||||
سپس در بین گزینه های موجود گزینه هایی که شامل en_US میشوند را پیدا کنید (به ترتیب الفباه که راحت بتونید پیدا کنید همش کنار همن) و با کلید space آنهارا انتخاب کنید
|
||||
|
||||
سپس با استفاده از کلید tab گزینه <code><ok></code>در پایین را بزنید و مجددا همان گزینه را بزنید تا لوکال ها لود بشوند
|
||||
|
||||
سپس با دستور زیر زبیکس را ریاستارت کنید
|
||||
sudo systemctl restart zabbix-server zabbix-agent apache2
|
||||
|
||||
== محیط نرم افزار ==
|
||||
[[پرونده:Zabbix-dashboard.png|حاشیه|وسط|بیقاب|865x865پیکسل]]
|
||||
درصورت مشاهده این تصویر (من رنگ پس زمینه رو مشکی کردم که در ادامه روش اینکار را به شما یاد خواهم داد)
|
||||
|
||||
رم سی پی یو در قسمت شمال غربی تصویر ساعت 9 تا 10 و نیم بالا سمت چپ اولین آیتم از بالا و دومین سمت چپ به اسم top hosts by cpu utiliization است که zabbix سرور، کلاینتیه که زبیکس در آن قرار دارد میزان utilization میزان کارایی سی پی یو (میزان استفاده شده سی پی) را به درصد بیان میکند و همچنین قسمت های 1m avg میانگین رم سی پی یو در یک دیقه اخیر، 5m avg در پنج دیقه اخیر، و 15m در پانزده دیقه اخیر نشان میدهد
|
||||
|
||||
در زیر قسمت سی پی یو و رم host availability قرار دارد که سرور های فعال، غیر فعال و نامشخص و تعداد کل به ترتیب چپ به راست را نشان میدهد
|
||||
|
||||
در سمت راست هاست problems by severtiy قرار دارد که تعداد ارور های سرور را نشان میدهد
|
||||
|
||||
در سمت راست پرابلمز geomap قرار دارد که یک لوکیشن در پایتخت لتونی یعنی ریگا را به شما نمایش میدهد و اگر خواستید میتونید به آنجا بروید و سازندگان این نرم افزار کاربردی را از نزدیک مشاهده کنید
|
||||
|
||||
در قسمت system information اطلاعات سیستم قرار دارد
|
||||
|
||||
ور در قسمت current problems ارور های فعلی
|
||||
|
||||
برای عوض کردن بک گراند به لوکیشن زیر بروید (از طریق نوار سمت راست) و تم دلخواه خود را انتخاب کنید
|
||||
administration > general > gui > default theme
|
||||
54
Monitoring & Logging/Zabbix/install_zabix.sh
Normal file
54
Monitoring & Logging/Zabbix/install_zabix.sh
Normal file
@@ -0,0 +1,54 @@
|
||||
#!bin/bash
|
||||
|
||||
DISTRO=$(lsb_release -is)
|
||||
if [ "$DISTRO" != "Ubuntu" ]; then
|
||||
echo "This script is designed for Ubuntu. Exiting..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
|
||||
#update package list and upgrade them
|
||||
|
||||
sudo apt update && sudo apt upgrade -y
|
||||
|
||||
#install prerequisite packeges
|
||||
|
||||
sudo apt install wget gnupg lsb-release -y
|
||||
|
||||
#Add zabix repo
|
||||
|
||||
wget https://repo.zabbix.com/zabbix/6.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu$(lsb_release -sc)_all.deb
|
||||
|
||||
sudo dpkg -i zabbix-release_6.4-1+${(lsb_release -sc)_all.deb
|
||||
|
||||
sudo apt update
|
||||
|
||||
#install zabix server-mysql
|
||||
sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent -y
|
||||
|
||||
#install mysql and configure it
|
||||
|
||||
sudo apt install mysql-server -y
|
||||
sudo systemctl start mysql
|
||||
sudo systemctl enable mysql
|
||||
|
||||
# creating database
|
||||
|
||||
echo "please enter a password for zabix"
|
||||
read -s ZABBIX_DB_PASS
|
||||
mysql -uroot -p -e "create database zabbix character set utf8 collate utf8_bin;"
|
||||
mysql -uroot -p -e "create user zabbix@localhost identified by '$ZABBIX_DB_PASS';"
|
||||
mysql -uroot -p -e "grant all privileges on zabbix.* to zabbix@localhost;"
|
||||
zcat /usr/share/doc/zabbix-sql-scripts/mysql/create.sql.gz | mysql -uzabbix -p$ZABBIX_DB_PASS zabbix
|
||||
|
||||
#update pass
|
||||
|
||||
sudo sed -i "s/# DBPassword=/DBPassword=$ZABBIX_DB_PASS/" /etc/zabbix/zabbix_server.conf
|
||||
|
||||
# Start Zabbix server and agent processes
|
||||
sudo systemctl restart zabbix-server zabbix-agent apache2
|
||||
sudo systemctl enable zabbix-server zabbix-agent apache2
|
||||
|
||||
|
||||
echo "done!,installation complated!"
|
||||
BIN
Monitoring & Logging/Zabbix/mysql.png
Normal file
BIN
Monitoring & Logging/Zabbix/mysql.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 82 KiB |
44
Monitoring & Logging/netdata/netdata-install.md
Normal file
44
Monitoring & Logging/netdata/netdata-install.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# NetData
|
||||
|
||||
NetData is an open-source, real-time system and performance monitoring tool designed for Linux systems. It provides detailed insights into various aspects of system performance, including CPU usage, memory utilization, disk activity, network traffic, and more. NetData offers an interactive, web-based dashboard that allows users to monitor and analyze their system's health in real-time.
|
||||
|
||||
## Key Features
|
||||
|
||||
- **Real-time Monitoring:** NetData provides continuous, minute-by-minute updates on system performance, giving users immediate visibility into any issues or anomalies.
|
||||
|
||||
- **Comprehensive Metrics:** It offers a wide range of metrics, covering CPU, memory, disks, network interfaces, processes, and more, enabling users to identify and address performance bottlenecks.
|
||||
|
||||
- **Interactive Web Interface:** The web-based dashboard is intuitive and user-friendly, allowing users to navigate through different metrics and customize their monitoring experience.
|
||||
|
||||
- **Alerting and Notifications:** NetData supports customizable alarms that can be set to trigger notifications for specific performance thresholds. This enables proactive monitoring and issue resolution.
|
||||
|
||||
- **Easy Installation:** NetData can be easily installed on Linux systems, and it requires minimal configuration to start monitoring.
|
||||
|
||||
## Supported Platforms
|
||||
|
||||
NetData is primarily designed for Linux-based systems, including popular distributions like Ubuntu, CentOS, Debian, and others. It can also be used on FreeBSD systems.
|
||||
|
||||
## Installation
|
||||
|
||||
**Important : Run Command Az Sudoer User**
|
||||
|
||||
To install NetData, follow these steps:
|
||||
|
||||
- Download Installer Script
|
||||
```bash
|
||||
wget https://my-netdata.io/kickstart.sh
|
||||
```
|
||||
|
||||
- Move To Temp Dir
|
||||
|
||||
```bash
|
||||
mv kickstart.sh /tmp/kickstart.sh
|
||||
```
|
||||
|
||||
- Run Installer
|
||||
|
||||
```bash
|
||||
sh /tmp/netdata-kickstart.sh
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user