A general introduction on how to handle logging and monitoring on VMware Photon OS.
VMware has an extensive ecosystem of products for maintaining control over their applications. This includes monitoring, logging, and more. However, if you prefer or need alternative methods, you have come to the right page.
You will need to install a system for log processing. My recommmendation is go for rsyslog.
- The installation is done by:
tdnf install rsyslog
-
The you need to configure the destination syslog server, replace the line:
*.* @@remote-host:514with*.* @@syslog.of.your:514. Where syslog.of.your is the namn or IP address of your syslog server. -
restart and enable rsyslog
systemctl restart rsyslog.service
systemctl enable rsyslog.service
- Sending specific log
You can configure rsyslog to handle specific files to be sent to the syslog server. This is done in the configuration file:
/etc/rsyslog.d/application.conf.
See the documentation for more details.
In my repository, Nagios Bash Plugins. I have four small Bash scripts that will likely provide all the help you may need. These scripts check tasks, CPU, memory, or swap using the top command. The disk utilization, file age with a few attributes, and, of course, Linux processes.
All the scripts can be installed locally and then executed using SSH from the authorized monitoring server. Be aware of security!
- Use a local account with just enough privileges; consider using sudo, for example, to limit access specifically for these file checks.
- Utilize SSH keys for authentication.
- Restrict login access to only the necessary IP addresses.
You will need to install (tdnf install net-snmp) and configure (snmpconf -g basic_setup) the snmp services on your system. Carefully consider which version to use and why. Your options are essentially v2 or v3.
When all the configuration is done, then you can start to explore the OIDs in the table below:
| OID | Used for |
|---|---|
| 1.3.6.1.2.1.1.3.0 | Timeticks/Uptime (for the snmpd process) |
| 1.3.6.1.2.1.1.5.0 | hostname |
| 1.3.6.1.4.1.2021.10.1.3.1 | Load 1 min |
| 1.3.6.1.4.1.2021.10.1.3.2 | Load 5 min |
| 1.3.6.1.4.1.2021.10.1.3.3 | Load 15 min |
| 1.3.6.1.4.1.2021.4.5.0 | Total RAM in machine |
| 1.3.6.1.4.1.2021.4.6.0 | Total RAM used |
| 1.3.6.1.4.1.2021.4.11.0 | Total RAM Free |
| 1.3.6.1.4.1.2021.4.3.0 | Total Swap Size |
| 1.3.6.1.4.1.2021.4.4.0 | Available Swap Space |
| 1.3.6.1.4.1.2021.9.1.6.1 | Total size of the disk/partion (kBytes): . |
| 1.3.6.1.4.1.2021.9.1.7.1 | Available space on the disk |
| 1.3.6.1.4.1.2021.9.1.8.1 | Used space on the disk |
| 1.3.6.1.4.1.2021.9.1.9.1 | Percentage of space used on disk |
| 1.3.6.1.2.1.25.4.2.1.2 | Process list |
If you're already familiar with Prometheus and Grafana, why not simply install and run the Prometheus Node Exporter? You have a few choices for doing that:
- Configure and run it as a container application.
- Create your own RPM using the community spec file, node_exporter.spec.
- Install it locally using my script install_prometheus_exporter.sh, which is part of my repository Prometheus_on_PhotonOS.