Open MarcusOngKianSiong opened 1 month ago
application stat fuel alerts:
Key words analysis:
Key words:
Time Status Host Problem
NOTE: THE GOAL IS TO IMPLEMENT A "LEGIT" SYSTEM THAT LOOKS LIKE WHAT THEY HAVE. THE PROBLEM IS THAT THEY ARE MONITORING THINGS THAT ARE BEYOND THE SCOPE OF MY PROJECT. FOR EXAMPLE, THEY ARE MONITORING THE BUSINESS LOGIC (dbobserver), WHICH REQUIRE THE DIRECT MONITORING OF THE CODE BASE (I THINK). MY CODE BASE IS SIMPLE AS I AM JUST CONNECTING THINGS AND MAKING SURE THEY FLOW SMOOTHLY.
I think I will use my own needs as the basis for determining the dashboard needs.
Query: What would I want to know in my system?
I am always worried that some link in the system breaks
I am worried that some components suddenly fail to work when I did not change anything beyond a specific supposed safe area (e.g. https://github.com/MarcusOngKianSiong/personal_website_backend_python/issues/3).
What are some painpoints I face when maintaining the system?
✅ Is the database running? ✅ Can I reach the port the database is listening to? ✅ Is the port attached to the database?
Visualisation: Can I get data from the database?
Curate a list of item checklist, and specify last checked detail.
Revised direction:
- Must not go down
- CPU limits:
- Ram?
- available storage
lsof -i :5433
command.❌ Potential Cause 1: I think it is the file permission issue
On the database VM OS, I run the command as a
root
and asmarcus
user. The former produced the desired output. The latter produces nothing (empty)."other directives"
Efficiency: It is likely that I need to change permissions a lot. I cannot remember the exact commands and have to ask the chatbot, which is slow. I need to contextualise the commands, as I remember what I create much better.
Create an executable script that can
- ✅ Create groups:
[x] group create <group name>
- ✅ Attach groups to files:
[x] attach group <group name> <file path>
- ✅ Add users to groups:
[x] group add <group name> <user name>
- Change group permission for that file
- Remove group
- ✅ List groups in table format:
[x] show groups
Knowledge used
- Only one user AND one group can own a file at a time
✅ Stumbled upon a solution
Chaining commands, and have the next command read stdin
cmd:
echo <password> | sudo -S lsof -i :5433
How to make it such that I can modify the data obtained by the item?
Use preprocessing tab in the item
How to get data directly from commands?
system.run[<command here>]
When using commands directly, how to fulfil the password requirement? Chaining:
echo "<password>" | <command> -S <others>
How to directly get data from the database through a remote connection (not using the zabbix agent to help you)?
- You need the middleman between driver and the application: unixodbc
An intermediary between database drivers and applications.
Component files:
- File that defines ODBC drivers:
odbcinst.ini
A list of database drivers in the system.
- File that defines data sources:
odbc.ini
A list of data sources, OR CAN BE DEFINED AS a list with each containing details required to concretely establish a connection with a specific database (e.g. hostname, port).
Relations:
odbcinst.ini specifies all the database drivers that is available in the system, and
odbc.ini
uses the defined drivers specified inodbcinst.ini
to create connections with the database.
- Data sources:
- Database driver:
postgresql-odbc
- Uses ODBC protocol (Can it be used across networks or is it only for local connections?), which is the standard API for accessing database management systems.
- Understand
db.odbc.select
parameters
db.odbc.select
: Perform queries using ODBC connections (Open Database Connectivity)
Not through zabbix agent, since the goal is to validate the certainty of the remote connection.
Need to download the required package.
Cannot connect to ODBC DSN: [SQL_ERROR]:[08001][101][[unixODBC]connection to server on socket "/run/postgresql/.s.PGSQL.5433" failed: No such file or directory Is the server runni]
Analysis
Host
for the ip address in odbc.ini file. I had it as Server
.Servername
instead.Appendix
I need to learn how to configure widgets in Zabbix to properly display the items I configured ( check database reachability). But the the server produced an error (error 500), and now I am pushed away from the main path, towards a side path, where the goal is to try and get back on the main path.
I felt like this is a repeat of another previously encountered problem: https://github.com/MarcusOngKianSiong/personal_website_backend_python/issues/3
Sudden error 500 when configuring widgets in zabbix.
It is like the web browser cannot reach it.
Information gathering:
The client application gets an HTTP status code of 500 with the message Internal Server Error as a response for API calls.
The HTTP status code 500 is a generic error response. It means that the server encountered an unexpected condition that prevented it from fulfilling the request. This error is usually returned by the server when no other error code is suitable.
The hints:
2024/10/21 15:05:27 [error] 19454#19454: *68 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Class "Modules\LessonGaugeChart\Includes\CWidgetFieldTextBox" not found in /usr/share/zabbix/modules/test/includes/WidgetForm.php:14
nc
command and Invoke-WebRequest
, and it worked
I can see the html in the content of the response. I can even put that into a html file and display it.
After I deleted the test directory inside /usr/share/zabbix/modules
, it suddenly worked again.
What other problems will I face? No items are gathering data.
Error:
cannot find modules/test
When I added back
test
directory with themanifest.json
file with some configuration specifications, the error disappeared, and I can collect item data once again. Based on ChatGPT, when you "run" the widget, it becomes stored in the database.
The hint