amonapp / amonagent

Single binary agent for Linux

Home Page:https://amon.cx

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"check-process.rb -p amonagent" failing

beardedeagle opened this issue · comments

amonagent appears to be sending bad check data to the amon server:

[~]# getent group amon
amon:x:397:
[~]# grep "amon" /etc/passwd
amon:x:995:397::/etc/opt/amon:/bin/false
amonagent:x:994:994::/etc/opt/amonagent:/bin/false
[~]# gem install sensu-plugins-process-checks
[~]# su -g amon -c "check-process.rb -p amonagent"
CheckProcess OK: Found 1 matching processes; cmd /amonagent/
[~]# su -s /bin/bash amon
bash-4.2$ whoami
amon
bash-4.2$ check-process.rb -p amonagent
CheckProcess OK: Found 1 matching processes; cmd /amonagent/

However when I go into the amon dashboard all amonagent checks are failing, with:

CheckProcess CRITICAL: Found 0 matching processes; cmd /amonagent/

I should also point out I am only seeing this issue with amonagent.

@beardedeagle Can you run this one through the agent with amonagent -test-plugin=checks

@martinrusev:

[~]# amonagent -test-plugin=checks
[{"name":"","command":"check-process.rb -p amon","exit_code":0,"output":"CheckProcess OK: Found 7 matching processes; cmd /amon/\n","error":""} {"name":"","command":"check-process.rb -p nginx","exit_code":0,"output":"CheckProcess OK: Found 5 matching processes; cmd /nginx/\n","error":""} {"name":"","command":"check-process.rb -p mongod","exit_code":0,"output":"CheckProcess OK: Found 1 matching processes; cmd /mongod/\n","error":""} {"name":"","command":"check-process.rb -p amonagent","exit_code":0,"output":"CheckProcess OK: Found 1 matching processes; cmd /amonagent/\n","error":""}]

@beardedeagle And what about this command su -g amonagent -c "check-process.rb -p amonagent"

@martinrusev more of the same:

[~]# su -g amonagent -c "check-process.rb -p amonagent"
CheckProcess OK: Found 1 matching processes; cmd /amonagent/
[~]# su -s /bin/bash amonagent
bash-4.2$ whoami
amonagent
bash-4.2$ check-process.rb -p amonagent
CheckProcess OK: Found 2 matching processes; cmd /amonagent/