masakari-processmonitor in masakari-monitors

Bug #1958093 reported by luffy Wong
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
masakari-monitors
New
Undecided
Unassigned

Bug Description

Document Misleading

https://docs.openstack.org/masakari-monitors/latest/processmonitor.html

The sample of proce_list.yaml definitions can't be parsed by process monitor.
# nova-compute
process_name: /usr/local/bin/nova-compute
start_command: systemctl start nova-compute
pre_start_command:
post_start_command:
restart_command: systemctl restart nova-compute
pre_restart_command:
post_restart_command:
run_as_root: True

It will occure an error like this:
2022-01-14 17:49:36.712 3801583 ERROR masakarimonitors.processmonitor.process [-] Exception caught: string indices must be integers: TypeError: string indices must be integers
2022-01-14 17:49:36.712 3801583 ERROR masakarimonitors.processmonitor.process Traceback (most recent call last):
2022-01-14 17:49:36.712 3801583 ERROR masakarimonitors.processmonitor.process File "/usr/local/lib/python3.6/site-packages/masakarimonitors/processmonitor/process.py", line 67, in main
2022-01-14 17:49:36.712 3801583 ERROR masakarimonitors.processmonitor.process self.process_handler.start_processes()
2022-01-14 17:49:36.712 3801583 ERROR masakarimonitors.processmonitor.process File "/usr/local/lib/python3.6/site-packages/masakarimonitors/processmonitor/process_handler/handle_process.py", line 79, in start_processes
2022-01-14 17:49:36.712 3801583 ERROR masakarimonitors.processmonitor.process cmd_str = process['start_command']
2022-01-14 17:49:36.712 3801583 ERROR masakarimonitors.processmonitor.process TypeError: string indices must be integers

The correct yaml config of process_list.yaml should be a array like below:

-
  process_name: /usr/sbin/libvirtd
  start_command: systemctl start libvirtd
  pre_start_command:
  post_start_command:
  restart_command: systemctl restart libvirtd
  pre_restart_command:
  post_restart_command:
  run_as_root: True

-
  process_name: /usr/bin/python3 /usr/bin/nova-compute
  start_command: systemctl start openstack-nova-compute
  pre_start_command:
  post_start_command:
  restart_command: systemctl restart openstack-nova-compute
  pre_restart_command:
  post_restart_command:
  run_as_root: True

luffy Wong (luffy963)
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.