Skip to content

Commit ae0502a

Browse files
update readme
1 parent f52e680 commit ae0502a

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

cloud-monitoring/README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ You can create a docker container and run a script `slottifier.py` by running:
3232
``` docker run --rm harbor.stfc.ac.uk/stfc-cloud/cloud-monitoring:latest \
3333
--volume /tmp/monitoring.conf:/app/monitoring.conf \
3434
--volume /tmp/clouds.yaml:/etc/openstack/clouds.yaml \
35-
slottifier /app/monitoring.conf
35+
slottifier
3636
```
3737

3838
## Local Python Package
@@ -56,8 +56,7 @@ docker build . -t cloud-monitoring:1
5656
docker run --rm cloud-monitoring:1 \
5757
--volume /tmp/monitoring.conf:/app/monitoring.conf \
5858
--volume /tmp/clouds.yaml:/etc/openstack/clouds.yaml \
59-
slottifier /app/monitoring.conf
60-
59+
slottifier
6160
```
6261

6362
# Usage
@@ -99,4 +98,17 @@ This script collects various service statuses, usages and limits for all hypervi
9998

10099
`python -m cloudMonitoring vm-states /tmp/monitoring.conf`
101100

102-
This script is used to total the number of virtual machines in running, shutoff, errored and build states
101+
This script is used to total the number of virtual machines in running, shutoff, errored and build states
102+
103+
104+
# Creating Cron jobs
105+
You can create a cron job like so:
106+
```commandline
107+
sudo tee /etc/cron.d/service-stats.cron > /dev/null << 'EOF'
108+
# run every hour
109+
0 * * * * root docker run --rm harbor.stfc.ac.uk/stfc-cloud/cloud-monitoring:latest \
110+
--volume /tmp/monitoring.conf:/app/monitoring.conf \
111+
--volume /tmp/clouds.yaml:/etc/openstack/clouds.yaml \
112+
slottifier
113+
EOF
114+
```

0 commit comments

Comments
 (0)