Closed uojiaku closed 7 years ago
I keep getting this error message. What should I do?
Try removing the ,
after /var
.
Here's what I get.
[uojiaku@mylaptop plugins]$ /etc/sensu/plugins/check-fs-writable.rb --dir / ,/data/,/var /etc/sensu/plugins/check-fs-writable.rb:37: syntax error, unexpected ':', expect ing kEND description: 'Directory to check for writability', ^ /etc/sensu/plugins/check-fs-writable.rb:37: syntax error, unexpected ',', expect ing kEND /etc/sensu/plugins/check-fs-writable.rb:38: syntax error, unexpected ',', expect ing kEND /etc/sensu/plugins/check-fs-writable.rb:39: syntax error, unexpected ',', expect ing kEND /etc/sensu/plugins/check-fs-writable.rb:43: syntax error, unexpected ':', expect ing kEND description: 'Auto discover mount points via fstab', ^ /etc/sensu/plugins/check-fs-writable.rb:43: syntax error, unexpected ',', expect ing kEND /etc/sensu/plugins/check-fs-writable.rb:44: syntax error, unexpected ',', expect ing kEND /etc/sensu/plugins/check-fs-writable.rb:48: syntax error, unexpected ':', expect ing kEND description: 'Print debug statements', ^ /etc/sensu/plugins/check-fs-writable.rb:48: syntax error, unexpected ',', expect ing kEND
Please run which ruby
and ruby -v
and paste the output.
[uojiaku@mylaptop plugins]$ sudo ruby -v ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux]
So I tried this and got a good result:
[uojiaku@mylaptop plugins]$ /opt/sensu/embedded/bin/ruby /etc/sensu/plugins/check-fs-writable.rb -d /tmp CheckFSWritable OK: All filesystems are writable
But when I tried:
[uojiaku@mylaptop plugins]$ sudo /opt/sensu/embedded/bin/ruby /etc/sensu/plugins/check-fs-writable.rb -a CheckFSWritable WARNING: No mount points found
I know I have mount points listed.
well, what does your /etc/fstab
say?
If I had to take a guess it would be this: https://github.com/sensu-plugins/sensu-plugins-filesystem-checks/blob/master/bin/check-fs-writable.rb#L71-L73
def acquire_vol_groups
`vgdisplay|grep 'VG Name'|awk '{print $3}'`
end
When it shells back out it is no longer using its sudo privs. We could maybe enhance it with an option to sudo this.
closing due to inactivity, if you would still like help please comment back with the requested information and we will be more than happy re-open and work through your issue.
uojiaku@mylaptop plugins]$ /etc/sensu/plugins/check-fs-writable.rb --dir /,/data,/var, /etc/sensu/plugins/check-fs-writable.rb:37: syntax error, unexpected ':', expecting kEND description: 'Directory to check for writability', ^ /etc/sensu/plugins/check-fs-writable.rb:37: syntax error, unexpected ',', expecting kEND /etc/sensu/plugins/check-fs-writable.rb:38: syntax error, unexpected ',', expecting kEND /etc/sensu/plugins/check-fs-writable.rb:39: syntax error, unexpected ',', expecting kEND /etc/sensu/plugins/check-fs-writable.rb:43: syntax error, unexpected ':', expecting kEND description: 'Auto discover mount points via fstab', ^ /etc/sensu/plugins/check-fs-writable.rb:43: syntax error, unexpected ',', expecting kEND /etc/sensu/plugins/check-fs-writable.rb:44: syntax error, unexpected ',', expecting kEND /etc/sensu/plugins/check-fs-writable.rb:48: syntax error, unexpected ':', expecting kEND description: 'Print debug statements', ^ /etc/sensu/plugins/check-fs-writable.rb:48: syntax error, unexpected ',', expecting kEND