1

I cannot get the most basic script working on monitoring mongodb on ubuntu 16.04 monit 5.16

check process mongod with pidfile /var/run/mongod.pid
  group database
  start program = "/usr/sbin/service mongod start"
  stop program = "/usr/sbin/service mongod stop"
  if failed host 127.0.0.1 port 27017 protocol http
    and request "/" with timeout 15 seconds then restart

I get the error: Error reading pid from file '/var/run/mongod.pid'

but when I run cat /var/run/mongod.pid as a regular user I do get the value 51455

I've changed permissions making it both less (0x777) and more restrictive to no avail. Anyone come across this?

farhadf
  • 115
  • 6

1 Answers1

0

Could try to change permission of mongodb pid file to "mongodb process user":"monit process user", I think issue is mongodb normally running as mongodb user and monit as root, please try this. Hope this will help.

asktyagi
  • 2,401
  • 1
  • 5
  • 19