file_dirs_names_service_plugin

Bug #1625966 reported by Tomasz Trębski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Monasca
New
Undecided
Unassigned

Bug Description

Info:

Cannot configure ServicePlugin to watch file in directory

Reproduce:

Download master branch of monasca-agent
Execute: monasca-setup -d keystone -a "file_dirs_names=[('/var/log/apache2',['keystone.log','keystone_access.log'])]"

Expected:

Plugin successfully created monitoring aforementioned files

Observed:

(monasca-agent) root@devstack:/home/vagrant/devstack# monasca-setup -d keystone -a "file_dirs_names=[('/var/log/apache2',['keystone.log','keystone_access.log'])]"
Traceback (most recent call last):
  File "/opt/monasca-agent/bin/monasca-setup", line 11, in <module>
    sys.exit(main())
  File "/opt/monasca-agent/local/lib/python2.7/site-packages/monasca_setup/main.py", line 76, in main
    skip_failed=(args.detection_plugins is None))
  File "/opt/monasca-agent/local/lib/python2.7/site-packages/monasca_setup/main.py", line 299, in plugin_detection
    new_config = detect.build_config_with_name()
  File "/opt/monasca-agent/local/lib/python2.7/site-packages/monasca_setup/detection/plugin.py", line 52, in build_config_with_name
    conf = self.build_config()
  File "/opt/monasca-agent/local/lib/python2.7/site-packages/monasca_setup/detection/service_plugin.py", line 135, in build_config
    file_names = file_dir_name[1]
IndexError: string index out of range

It looks like iteration over file_dirs_names expects that argument will be parsed into an array, however it is still a string at this point therefore iteration goes by each character in this string.

Revision history for this message
Kaiyan (kaiyan-sheng) wrote :

For file_size and directory check, monasca-setup command line is not support it. Because depends on the files, the directory and file name combination can be very long. Right now, you can create your own customer defined detection plugin based on the template: https://github.com/openstack/monasca-agent/blob/master/monasca_setup/detection/plugins/file_size.py to run file_size check.

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.