initial commit of bin scripts into git
This commit is contained in:
18
node-collector-cron
Executable file
18
node-collector-cron
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
# uncomment to test
|
||||
#exit 0
|
||||
|
||||
# this is complex, we use cron to run stuff, but if cron fails, no script gets
|
||||
# an update, BUT, as prometheus is just looking at the last state of the file,
|
||||
# it would see the last values and think they are 'current'.
|
||||
#
|
||||
# SO, lets timestamp when we ran this, rather than give a 0 or 1, because if
|
||||
# its running this will update the timestamp, if not, it wont anyway :)
|
||||
|
||||
log_file=/srv/docker/container/node-exporter/textfile_collector/cron.prom
|
||||
|
||||
echo "# HELP node_cron_is_running Check to tell us when Cron last ran" > $log_file
|
||||
echo "# TYPE node_cron_is_running gauge" >> $log_file
|
||||
|
||||
echo "node_cron_is_running{what=\"last_in_secs\"} `date +%s`" >> $log_file
|
||||
Reference in New Issue
Block a user