# Disk Stats not working with Cacti plugins v1.04

**URL:** <https://forums.percona.com/t/disk-stats-not-working-with-cacti-plugins-v1-04/2962>\
**Category:** Percona Monitoring Plugins\
**Created:** [September 23, 2013, 6:38pm UTC](https://forums.percona.com/t/disk-stats-not-working-with-cacti-plugins-v1-04/2962 "2013-09-23T18:38:16Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![cdukes](https://avatars.discourse-cdn.com/v4/letter/c/c4cdca/32.png) [@cdukes](https://forums.percona.com/u/cdukes)\
**Post date:** [September 23, 2013, 6:38pm UTC](https://forums.percona.com/t/disk-stats-not-working-with-cacti-plugins-v1-04/2962/1 "2013-09-23T18:38:16Z")

</div>

I tried searching to see if this was posted before, but oddly, there doesn’t seem to be a way to search these forums?

I am trying to collect disk stats on my server and, according to this:  
[URL][http://www.percona.com/doc/percona-monitoring-plugins/cacti/linux-templates.html[/URL]](http://www.percona.com/doc/percona-monitoring-plugins/cacti/linux-templates.html%5B/URL%5D)  
I need to use the volume name.

I’ve actually tried just about every permutation of this that I can think of, none of which return values.  
On my server, I have:

```auto
# lsblk 
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 9.1T 0 disk 
├─sda1 8:1 0 1M 0 part 
├─sda2 8:2 0 244M 0 part /boot
└─sda3 8:3 0 9.1T 0 part 
├─lzbfs-root (dm-0) 252:0 0 9T 0 lvm /
└─lzbfs-swap_1 (dm-1) 252:1 0 96G 0 lvm 
sr0 11:0 1 1024M 0 rom 

```

And

```auto
# pvdisplay 
--- Physical volume ---
PV Name /dev/sda3
VG Name lzbfs
PV Size 9.09 TiB / not usable 1.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 2383298
Free PE 0
Allocated PE 2383298
PV UUID SuoiPA-4Dgl-K6zd-Qqdx-KYdT-2U2D-GsxdjK

```

I need to get stats for lzbfs-root. I have tried the following, but all return -1:

```auto
/usr/bin/php -q /usr/share/cacti/site/scripts/ss_get_by_ssh.php --host 192.168.28.29 --type df --items jw,jx --volume lzbfs-root
jw:-1 jx:-1
/usr/bin/php -q /usr/share/cacti/site/scripts/ss_get_by_ssh.php --host 192.168.28.29 --type df --items jw,jx --volume sda3
jw:-1 jx:-1
/usr/bin/php -q /usr/share/cacti/site/scripts/ss_get_by_ssh.php --host 192.168.28.29 --type df --items jw,jx --volume /dev/sda3
jw:-1 jx:-1
/usr/bin/php -q /usr/share/cacti/site/scripts/ss_get_by_ssh.php --host 192.168.28.29 --type df --items jw,jx --volume dm-0
jw:-1 jx:-1
/usr/bin/php -q /usr/share/cacti/site/scripts/ss_get_by_ssh.php --host 192.168.28.29 --type df --items jw,jx --volume /
jw:-1 jx:-1
/usr/bin/php -q /usr/share/cacti/site/scripts/ss_get_by_ssh.php --host 192.168.28.29 --type df --items jw,jx --volume lzbfs
jw:-1 jx:-1

```

As I understand the docs, it is supposed to work using the volume name from lsblk…in my case “lzbfs-root”, but it doesn’t seem to work.  
Can someone explain what I am doing wrong?

NB:  
Other commands from get\_by\_ssh.php that are not disk related do work correctly.

---

<div class="post-metadata">

**Author:** ![weber](https://avatars.discourse-cdn.com/v4/letter/w/da6949/32.png) [@weber](https://forums.percona.com/u/weber)\
**Post date:** [September 24, 2013, 9:35am UTC](https://forums.percona.com/t/disk-stats-not-working-with-cacti-plugins-v1-04/2962/2 "2013-09-24T09:35:22Z")

</div>

Please show me your “df” output. The volume should be the way it is listed in the first column of “df” output.

---

<div class="post-metadata">

**Author:** ![cdukes](https://avatars.discourse-cdn.com/v4/letter/c/c4cdca/32.png) [@cdukes](https://forums.percona.com/u/cdukes)\
**Post date:** [September 24, 2013, 5:26pm UTC](https://forums.percona.com/t/disk-stats-not-working-with-cacti-plugins-v1-04/2962/3 "2013-09-24T17:26:13Z")

</div>

```auto
~# df
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/lzbfs-root 9.0T 174G 8.9T 2% /
udev 48G 12K 48G 1% /dev
tmpfs 19G 628K 19G 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 48G 92K 48G 1% /run/shm
/dev/sda2 229M 29M 188M 14% /boot

```

---

<div class="post-metadata">

**Author:** ![weber](https://avatars.discourse-cdn.com/v4/letter/w/da6949/32.png) [@weber](https://forums.percona.com/u/weber)\
**Post date:** [September 25, 2013, 4:39am UTC](https://forums.percona.com/t/disk-stats-not-working-with-cacti-plugins-v1-04/2962/4 "2013-09-25T04:39:17Z")

</div>

You have to use “/dev/mapper/lzbfs-root”, i.e.  
/usr/bin/php -q /usr/share/cacti/site/scripts/ss\_get\_by\_ssh.php --host 192.168.28.29 --type df --items jw,jx --volume /dev/mapper/lzbfs-root

---

<div class="post-metadata">

**Author:** ![cdukes](https://avatars.discourse-cdn.com/v4/letter/c/c4cdca/32.png) [@cdukes](https://forums.percona.com/u/cdukes)\
**Post date:** [September 25, 2013, 6:21am UTC](https://forums.percona.com/t/disk-stats-not-working-with-cacti-plugins-v1-04/2962/5 "2013-09-25T06:21:03Z")

</div>

I actually tried that before (just forgot to list it) and it doesn’t work:

```auto
/usr/bin/php -q /usr/share/cacti/site/scripts/ss_get_by_ssh.php --host 192.168.28.29 --type df --items jw,jx --volume /dev/mapper/lzbfs-root
jw:-1 jx:-1

```

---

<div class="post-metadata">

**Author:** ![weber](https://avatars.discourse-cdn.com/v4/letter/w/da6949/32.png) [@weber](https://forums.percona.com/u/weber)\
**Post date:** [September 26, 2013, 3:45am UTC](https://forums.percona.com/t/disk-stats-not-working-with-cacti-plugins-v1-04/2962/6 "2013-09-26T03:45:36Z")

</div>

‘DISKFREE\_used’ =\> ‘nj’,  
‘DISKFREE\_available’ =\> ‘nk’,

It should be --items nj,nk. Also please check that the script from PMP 1.0.4 tarball or package.

---

<div class="post-metadata">

**Author:** ![robvas](https://avatars.discourse-cdn.com/v4/letter/r/dfb087/32.png) [@robvas](https://forums.percona.com/u/robvas)\
**Post date:** [December 4, 2018, 1:50pm UTC](https://forums.percona.com/t/disk-stats-not-working-with-cacti-plugins-v1-04/2962/7 "2018-12-04T13:50:09Z")

</div>

I had a similar issue. Out of all of my servers, a couple of them would not report disk space. However, the other disk graphs worked fine such as Disk IOPS and Disk Read/Write/Time.

I saw the following error in my log file:

When I ran the script manually, I got the correct results:

# /usr/share/cacti/scripts/ss\_get\_by\_ssh.php --host ‘192.168.14.2’ --type df --items nj,nk --volume ‘/dev/mapper/centos-root’

nj:62762065920 nk:98220564480

However, that was as the root user. When I ran the script as the Cacti user, it failed.

# su cacti

bash-4.2$ /bin/php -q /usr/share/cacti/scripts/ss\_get\_by\_ssh.php --host ‘192.168.14.2’ --type df --items nj,nk --volume ‘/dev/mapper/centos-root’  
PHP Warning: fopen(/tmp/192.168.14.2\_\_dev\_mapper\_centos-root\_df\_cacti\_stats.txt): failed to open stream: Permission denied in /var/lib/cacti/scripts/ss\_get\_by\_ssh.php on line 527

Sure enough, there was a file in /tmp that was owned by root

I deleted all the files like this in file as root.

CMD: /bin/php -q /usr/share/cacti/scripts/ss\_get\_by\_ssh.php --host ‘192.168.14.2’ --type df --items nj,nk --volume ‘/dev/mapper/centos-root’, output: nj:62763327488 nk:98219302912

–volume '/dev/mapper/centos-root ’

---

<div class="post-metadata">

**Author:** ![lorraine.pocklington](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/lorraine.pocklington/32/37_2.png) [@lorraine.pocklington](https://forums.percona.com/u/lorraine.pocklington)\
**Post date:** [December 4, 2018, 2:16pm UTC](https://forums.percona.com/t/disk-stats-not-working-with-cacti-plugins-v1-04/2962/8 "2018-12-04T14:16:13Z")

</div>

Thank you for updating this post with your solution, it could save someone a lot of time in the future. Appreciated!
