[ZBX-5729] Zabbix agent does not support ocfs2 file system Created: 2012 Oct 24 Updated: 2017 May 30 Resolved: 2015 Oct 21 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Agent (G) |
Affects Version/s: | 2.0.2, 2.0.3 |
Fix Version/s: | None |
Type: | Incident report | Priority: | Minor |
Reporter: | Ugis | Assignee: | Unassigned |
Resolution: | Won't fix | Votes: | 3 |
Labels: | lld, ocfs2, oracle, virtualization | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
Agent installed on OracleVM virtualization server version 3.1.1. |
Attachments: |
![]() |
||||||||
Issue Links: |
|
Description |
Zabbix agent does not detect ocfs2 file system symptoms and detection process described here: |
Comments |
Comment by richlv [ 2012 Oct 25 ] | ||
could you please add a summary of the problem here (as per https://zabbix.org/wiki/Docs/bug_reporting_guidelines#Reporting_an_issue ), thanks | ||
Comment by Ugis [ 2012 Oct 25 ] | ||
Problem: file system discovery does not discover ocfs2 file systems Description: Problem is - agent does not discover mounted ocfs2 file systems(template OS linux, discovery rules). These file systems are visible as normal local file systems in "df -h" output like: and also in /proc/mounts like this: First idea was it is because the regexp for file system discovery did not include neither ocfs2 or ocfs. Zabbix server 2.0.3 I did additional tests on agent side: vfs.fs.discovery [s|{ "{#FSTYPE}":"ext3"}, ... "{#FSNAME} ":"\/proc\/sys\/fs\/binfmt_misc", ... "{#FSNAME}":"\/OVS\/Repositories\/0004fb000003000099de5999d1a266f8", "{#FSTYPE} ":"ocfs2"}, Then doing zabbix_get from server:
Additional info: upgrading zabbix_agentd to 2.0.3 did not help. | ||
Comment by richlv [ 2012 Oct 25 ] | ||
looks like it does discover them, but does not support monitoring them | ||
Comment by Alexander Vladishev [ 2013 Dec 16 ] | ||
Related issue: | ||
Comment by Ugis [ 2014 Aug 28 ] | ||
Hi, is there any progress or prognosis for this issue? | ||
Comment by richlv [ 2014 Aug 28 ] | ||
no specific plans at this time | ||
Comment by Ugis [ 2015 Sep 18 ] | ||
Tested with agent 2.4.6 no change. | ||
Comment by tfunk [ 2015 Sep 18 ] | ||
This is a problem in our 2.2.4 environment as well. The ocfs2 filesystems are discovered, but then go into "not supported" with "Not supported by Zabbix Agent". | ||
Comment by dimir [ 2015 Sep 22 ] | ||
I used the following script to create an OCFS2 partition on my Debian (stable, 8.1) box: TARGET_FILE=/home/vl/tmp/ocfs2 TARGET_MP=/mnt/ocfs2 TARGET_SIZE=200000 # bytes sudo umount $TARGET_MP >/dev/null 2>&1 dd if=/dev/zero of=$TARGET_FILE bs=1024 count=$TARGET_SIZE || exit 1 sudo mkfs.ocfs2 -b 4k -C 32K -L "MyOCFS2Cluster" -N 4 $TARGET_FILE || exit 1 sudo mount $TARGET_FILE $TARGET_MP || exit 1 After that df shows the filesystem properly $ df -h /mnt/ocfs2 Filesystem Size Used Avail Use% Mounted on /dev/loop0 196M 71M 126M 36% /mnt/ocfs2 $ grep /mnt/ocfs2 /proc/mounts /dev/loop0 /mnt/ocfs2 ocfs2 rw,relatime,_netdev,heartbeat=local,nointr,data=ordered,errors=remount-ro,atime_quantum=60,coherency=full,user_xattr,acl 0 0 So then I check if Zabbix filesystem discovery sees it and it does $ bin/zabbix_get -s localhost -p 11339 -k vfs.fs.discovery | json_xs [...] { "{#FSNAME}" : "/mnt/ocfs2", "{#FSTYPE}" : "ocfs2" } [...] Also getting the metrics of discovered entities works vl@dimir:trunk:trunk$ bin/zabbix_get -s localhost -k vfs.fs.size[/mnt/ocfs2] 204800000 vl@dimir:trunk:trunk$ bin/zabbix_get -s localhost -k vfs.fs.size[/mnt/ocfs2,pfree] 64.080000 Using latest trunk (pre-3.0.0-alpha3, r55678). In your examples seems some mapper is used. Is there different ways on how to set up OCFS2 partition? | ||
Comment by Ugis [ 2015 Sep 22 ] | ||
By design ocfs2 is cluster file system - it can be mounted from several hosts simultaneously. We use it clustered way. I compared mount options: Differences: cluster_stack=o2cb https://oss.oracle.com/projects/ocfs2-tools/dist/documentation/v1.4/o2cb.html atime_quantum=60
About /dev/mapper. It just forms single virtual LUN for use, but technically you can "see" same LUN via muptiple SAN paths. OCFS2 is formatted onto this virtual device(LUN). In case test setup is needed - easyest would be to set up iscsi target on some linux host and connect/format/mount ocfs2 luns from there to couple other machines, probably Virtualbox setup with 3 VMs on single host would be ok. | ||
Comment by dimir [ 2015 Oct 19 ] | ||
It doesn't look like a trivial task to set the cluster up on my Debian stable. Some tools are missing, perhaps also not the latest version. If you could give us an access to some test machine where we could play with it - that'd be great. Or if you could take some time and provide us with the simplest and easiest example, listing the exact sequence of commands on a fresh installation, on how to set this up and get the error - it would be great. Otherwise we do not have time to spend on learning all this technology at this time. | ||
Comment by dimir [ 2015 Oct 20 ] | ||
Also, thank you for trying agent 2.4.6, it gives more information on the error. Could you run the following command: $ strace zabbix_agentd -t vfs.fs.size[/OVS/Repositories/0004fb0000030000973b3c1631c70e2d] > /tmp/zabbix-ocfs2-strace.log 2>&1 and attach the generated log file? | ||
Comment by Ugis [ 2015 Oct 21 ] | ||
strace zabbix_agentd -t vfs.fs.size[/OVS/Repositories/0004fb0000030000973b3c1631c70e2d] | ||
Comment by Ugis [ 2015 Oct 21 ] | ||
While collecting strace log I discovered interesting thing: 1)"zabbix_agentd -t" when run on agent - it does return file system size, here folow some examples:
2)if "zabbix_get -s" is run for the same item regarding ocfs2 - it returns "Permission denied". For /boot(ext3) size is returned.
3)If zabbix_agentd is run as root(AllowRoot=1 in config) then also from server ocfs2 size value is returned
Where is the difference how agent asks values from ext3 vs ocfs2? | ||
Comment by dimir [ 2015 Oct 21 ] | ||
I assume that in case 1) you were running "zabbix_agentd" command as root? There is really no difference in how we get the size of a ext3 or any other filesystem partition size. We just use (or in your case, is used) statfs() system call. In your case when zabbix_agentd is running as non-root statfs() returns EACCESS (13, "Permission denied"). From the man page of statfs():
If there is a certain group for accessing ocfs2 partition you could add user "zabbix" to it. Also on one forum I saw people complaining about permission errors on ocfs2 which appeared to be because of SELinux. Perhaps you could check that also. | ||
Comment by Ugis [ 2015 Oct 21 ] | ||
Yes, in case 1) I run command as root. It turns out problem is simply file system permissions then. Filesystem Size Used Avail Use% Mounted on ... /dev/mapper/3600144f0ff43941b00005559ca760018 10G 4.2G 5.9G 42% /OVS/Repositories/0004fb0000030000973b3c1631c70e2d looking deeper ir turns out in the mddle of the path there is no access for zabbix user: # ls -ld /OVS drwxr-xr-x 3 root root 4096 Jun 11 15:03 /OVS # ls -ld /OVS/Repositories/ drwx------ 3 root root 4096 Sep 22 10:11 /OVS/Repositories/ # ls -ld /OVS/Repositories/0004fb0000030000973b3c1631c70e2d/ drwxr-xr-x 8 root root 3896 Sep 22 10:11 /OVS/Repositories/0004fb0000030000973b3c1631c70e2d/ SElinux is disabled. If I temporarily add execute permissions to the /OVS/Repositories/ for zabbix user, zabbix server can get value of that ocfs2 file system and also discover ocfs2 file system. Thanks for pointing to right direction! Initially I thought that it does not matter under what mount path file system is mounted to get its parameters for discovery. | ||
Comment by richlv [ 2015 Oct 21 ] | ||
thanks for the update, closing then | ||
Comment by Oleksii Zagorskyi [ 2016 Mar 03 ] | ||
One more test which proves that read/search permission is required for all folders on the path to a mount point:
# df -h | grep sda
/dev/sda2 184G 143G 41G 78% /
/dev/sda1 488M 31M 457M 7% /boot
/dev/sda5 14G 6.0G 6.5G 49% /root/1
# ps aux | grep zabbix | sed 'q'
zabbix 10326 0.0 0.0 95084 2760 ? S 23:02 0:00 ./zabbix_agentd
# whoami
root
# zabbix_get -s localhost -k vfs.fs.size[/root/1,pfree]
ZBX_NOTSUPPORTED: Cannot obtain filesystem information: [13] Permission denied
# zabbix_agentd -t vfs.fs.size[/root/1,pfree]
vfs.fs.size[/root/1,pfree] [d|51.871173]
# ls -ld /root
drwx------ 41 root root 4096 Mar 3 23:29 /root
# ls -ld /root/1
dr-x------. 20 root root 4096 Nov 15 18:40 /root/1
Fix parent folder permission for the mount point and successfully test: # chmod o+rx /root # ls -ld /root drwx---r-x 41 root root 4096 Mar 3 23:29 /root # zabbix_get -s localhost -k vfs.fs.size[/root/1,pfree] 51.871173 |