References
- Monitoring Amazon Web Services (AWS)
- Installing CheckMk (on virtual machine)
- Checkmk System requirements
Requirment
System Requirements
This is pretty sparse and lousy, but I found this:
Resource Requirements Based on the experience:
- One site, dozen hosts with Check_MK agent, and some hosts with SNMP: 1 CPU core, 1 GB RAM, min. 8-16 GB HDD (e.g. mini PC).
- One site, more dozen hosts with Check_MK agent, and dozen hosts with SNMP: 2 CPU core, 2 GB RAM, min. 40 GB HDD.
- One site, more than one hundred hosts with Check_MK agent, including more dozen host with log monitoring and vulnerability scan, dozen hosts with SNMP, and Event Console: 4 CPU core, 4 GB RAM, min. 80 GB HDD.
- One or more site, more than one hundred hosts with Check_MK agent, including log monitoring and vulnerability scan, more dozen hosts with SNMP, and Event Console: 6-8 CPU core, 4-8 GB RAM, min. 120 GB HDD.
- One or more site, more hundred hosts with Check_MK agent, including log monitoring and vulnerability scan, more hundred hosts with SNMP, Event Console: min. 8 CPU core, min. 8 GB RAM, min. 200 GB HDD.
The manufacturer's recommendations: https://mathias-kettner.com/check_mk_monitoring_appliance.html
Other Requirements
- And Elastic IP Address, so the checkserver has a reliable IP
- SSH key for server
- Created as checkmk-admin currently
Questions on Configuration
We could set up the monitor in two ways:
- One monitor for all bettrdata instances
- Advantages
- View across all hosts in a single place
- One instance for all sites is just one app to take care for upgrades
- Disadvantages
- Would need to be its own server, so adding an extra instance of EC2 by itself
- One monitor per instance
- Advantages
- Could live on the same host as the bettrdata instance
- Disadvantages
- Add more space needed per instance
- If the EC2 instance dies, the monitor also dies
Installing on Virtual Machine For Testing
- Creating virtual machine
- Install checkmk host on system (from deb)
- Create an instance of checkmk on the server
- You can have multiple instances on the same server
- You can have multiple instances on the same server
- Example command to create and start
- You will need to start the site and go to it (locally)
- Test site at http://checkmkadmin-VirtualBox/test_site/ in virtual box or port forward if desired
- Download the agent to install locally for the first test
- Install it
- Add the host in the admin UI
- Setup > Hosts > Add host
- Details
- Host name: monitor_system (could be anything, but no spaces)
- IPv4 address: whatever the local host ip address is
- Click on “Save & run service discovery”. A list of services appear after a few moments
- Choose the services you want (which could be all)
- Click on the changes sign (octogonal yellow icon with exclamation point, upper right) That will bring up the activation button (circular red arrow icon, middle left) Click to activate
- Click on the host in the top menu to get to the host summary, and click on the host name, monitor_system to see details.
- Click on services of host to see individual services
Install on EC2 Instance for Testing
Create an EC2 Instance
- Latest Ubuntu Free AMI
- Install checkmk
More Notes
Get the Agent
The agent installer is found in the checkmk ui. You will need to download it manually. Hopefully the file can be included in the ansible create and upgrade commands to both copy to the server and install. For the moment, I copied it manually to the EC2 instance
Install command (AWS OS is a version of redhat/fedora)
Open Ports Needed for CheckMk Agent
The checkmk agent runs on two port for the pull version:
- UDP
- 161
- TCP
- 6556
Open those ports to MY ipaddress for testing in the EC2 instance
Setting Up in CheckMk Admin
- Go to Setup > Host > Add Host
- Host name
- robpoc3_chkmk_agent
- IPv4 address:
- My ip address
- Monitoring agents
- Checmk agent / API integrations
- Then add all the service and changes etcetra as above
Install MongoDB Shell
I will do this manually for now, but we should have the mongodb shell installed by default. Most of the things we want to check are in the local mongodb instance
Installation Steps Via Yum (For now)
- Create the mongodb yum configuration
- Add the configuration (for Amazon LInux 2, which what we have)
- Install mongo-sh
sudo vi /etc/yum.repos.d/mongodb-org-8.0.repo
[mongodb-org-7.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2/mongodb-org/7.0/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-7.0.ascTest Queries
Mongoshell has integration with node, so we can create node scripts and run them to get results
- A simple script
- Run the script in mongoshell
ec2-user$ ./trapperqueuecollectioncheck.js
2 "trapper_queue_check" - "trapperqueue collection NOT foundSet Up the Local Check in Robpoc3 Instance
Create the path where the local check executable files should be located
ec2-user$ sudo su
root$ mkdir -p /usr/lib/check_mk_agent/local
root$ cd /home/ec2-user
root$ cp trapperqueuecollectioncheck.js /usr/lib/check_mk_agent/local
# run a check on the script locally
root$ cmk-agent-ctl dump | grep -v grep | grep -A2 "<<<local"
<<<local:sep(0)>>>
2 "trapper_queue_check" - "trapperqueue collection NOT found"
Connect The Local Service to The CheckMk Server
Now that we created a local check and it tests correcly, we can add it to the checkmk server
- In the server, go to Setup > Hosts
- Select the host where we added the local check, in this case robpoc3_monitor
- Click on the “Save & run service discovery”
- Now in the “Undecided services” section there is the new service, “trapper_queue_check”, which is the service we created. Click the plus sign to add it
- Click on the changes icon to show the “Activate pending changes” page
- Click on “Activate on selected sites” to activate
