Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
AnsibleMonitoring
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tec
AnsibleMonitoring
Commits
41a061af
Commit
41a061af
authored
Jan 13, 2020
by
tec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add MWE custom logging with node exporter collector (getent passwd count)
parent
b64f8828
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
monitor_client.yml
monitor_client.yml
+24
-0
No files found.
monitor_client.yml
View file @
41a061af
...
...
@@ -4,6 +4,7 @@
become_user
:
root
remote_user
:
root
pre_tasks
:
# because deb10 packages version works
-
name
:
Have prometheus-node-exporter
apt
:
name
:
prometheus-node-exporter
...
...
@@ -14,3 +15,26 @@
manager
:
auto
roles
:
-
{
role
:
cloudalchemy.node-exporter
,
when
:
"
ansible_facts.packages['prometheus-node-exporter']
is
not
defined"
}
tasks
:
-
name
:
Add getent passwd count monitor file
copy
:
dest
:
'
/usr/local/bin/getent-passwd-count.sh'
owner
:
root
mode
:
755
content
:
|
#!/bin/bash
#
# Expose getent user count
#
# Usage: add this to crontab:
# */5 * * * * /usr/local/bin/getent-passwd-count.sh | sponge /var/lib/node_exporter/getent_passwd_count.prom
echo "# HELP node_getent_passwd_count number of users known"
echo "# TYPE node_getent_passwd_count gauge"
echo "node_getent_passwd_count $(getent passwd | wc -l)"
-
name
:
Add getent passwd count monitor cron job
cron
:
name
:
Expose getent user count
minute
:
"
*/5"
user
:
root
job
:
"
/usr/local/bin/getent-passwd-count.sh
>
/var/lib/node_exporter/getent_passwd_count.prom"
cron_file
:
getent-passwd-count
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment