# Cacti SSH DISKFREE returning -1 randomly on just one volume

**URL:** <https://forums.percona.com/t/cacti-ssh-diskfree-returning-1-randomly-on-just-one-volume/3272>\
**Category:** Percona Monitoring Plugins\
**Created:** [February 13, 2014, 7:14am UTC](https://forums.percona.com/t/cacti-ssh-diskfree-returning-1-randomly-on-just-one-volume/3272 "2014-02-13T07:14:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ms124](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ms124/32/994_2.png) [@ms124](https://forums.percona.com/u/ms124)\
**Post date:** [February 13, 2014, 7:14am UTC](https://forums.percona.com/t/cacti-ssh-diskfree-returning-1-randomly-on-just-one-volume/3272/1 "2014-02-13T07:14:42Z")

</div>

Hello

We are using the template and script for getting Linux box stats via SSH. All is working well except randomly it reports back -1 for the root partition’s DISKFREE\_available and DISKFREE\_used. Strangely it only does it for one of several volumes checked for this box, all checked at the same time. We have thold running on this so it annoyingly triggers an email about low free space.

```auto
02/13/2014 12:01:28 PM - POLLER: Poller[0] Parsed MULTI output field 'nj:-1' [map nj->DISKFREE_used]
02/13/2014 12:01:28 PM - POLLER: Poller[0] Parsed MULTI output field 'nk:-1' [map nk->DISKFREE_available]
02/13/2014 12:01:28 PM - POLLER: Poller[0] Parsed MULTI output field 'nj:216727552' [map nj->DISKFREE_used]
02/13/2014 12:01:28 PM - POLLER: Poller[0] Parsed MULTI output field 'nk:786444288' [map nk->DISKFREE_available]
02/13/2014 12:01:28 PM - POLLER: Poller[0] Parsed MULTI output field 'nj:67098263552' [map nj->DISKFREE_used]
02/13/2014 12:01:28 PM - POLLER: Poller[0] Parsed MULTI output field 'nk:33221103616' [map nk->DISKFREE_available]
02/13/2014 12:01:28 PM - POLLER: Poller[0] Parsed MULTI output field 'nj:1564028928' [map nj->DISKFREE_used]
02/13/2014 12:01:28 PM - POLLER: Poller[0] Parsed MULTI output field 'nk:339497058304' [map nk->DISKFREE_available]
02/13/2014 12:01:28 PM - POLLER: Poller[0] CACTI2RRD: diskfree_used_336.rrd --template DISKFREE_used:DISKFREE_available 1392292864:-1:-1
02/13/2014 12:01:28 PM - POLLER: Poller[0] CACTI2RRD: diskfree_used_337.rrd --template DISKFREE_used:DISKFREE_available 1392292864:216727552:786444288
02/13/2014 12:01:28 PM - POLLER: Poller[0] CACTI2RRD: diskfree_used_341.rrd --template DISKFREE_used:DISKFREE_available 1392292864:67098263552:33221103616
02/13/2014 12:01:28 PM - POLLER: Poller[0] CACTI2RRD: diskfree_used_342.rrd --template DISKFREE_used:DISKFREE_available 1392292864:1564028928:339497058304

```

Can I get it to save the df out put to a log file maybe, see what’s happening better?

Thanks for your help

---

<div class="post-metadata">

**Author:** ![ms124](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ms124/32/994_2.png) [@ms124](https://forums.percona.com/u/ms124)\
**Post date:** [February 13, 2014, 7:49am UTC](https://forums.percona.com/t/cacti-ssh-diskfree-returning-1-randomly-on-just-one-volume/3272/2 "2014-02-13T07:49:46Z")

</div>

Ok, I’ve found the $debug\_log option in the ss\_get\_by\_ssh.php script. I shall see what it records when it happens next

---

<div class="post-metadata">

**Author:** ![ms124](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ms124/32/994_2.png) [@ms124](https://forums.percona.com/u/ms124)\
**Post date:** [February 18, 2014, 6:45am UTC](https://forums.percona.com/t/cacti-ssh-diskfree-returning-1-randomly-on-just-one-volume/3272/3 "2014-02-18T06:45:43Z")

</div>

Right, it has happened again now I have the debug log going.

So it is timing out connecting to the server and thus logging it as “-1”.

Is there a better way to log this or a way any one knows of to stop thold triggering?

```auto
array (
0 => 'result of ssh -q -o "ConnectTimeout 10" -o "StrictHostKeyChecking no" user&#64;host -p 22 -i id_rsa \'df -k -P\'',
1 => 'timed out',
)

```

I’ll try increasing the time out to see if it reduces the occurrences but I’d prefer a better solution to stop ‘false’ alarms emails. I understand this may be better aimed at the thold people so I’ll go find where I can ask them too.

Thank you!

---

<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:** [February 19, 2014, 9:01am UTC](https://forums.percona.com/t/cacti-ssh-diskfree-returning-1-randomly-on-just-one-volume/3272/4 "2014-02-19T09:01:53Z")

</div>

You can increase the timeout  
$cmd\_tout = 10; # Command exec timeout (ssh itself or local cmd)

in ss\_get\_by\_ssh.php.cnf.

---

<div class="post-metadata">

**Author:** ![ms124](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ms124/32/994_2.png) [@ms124](https://forums.percona.com/u/ms124)\
**Post date:** [February 20, 2014, 8:16am UTC](https://forums.percona.com/t/cacti-ssh-diskfree-returning-1-randomly-on-just-one-volume/3272/5 "2014-02-20T08:16:36Z")

</div>

I have done.

I’m wondering though, is the -1 the correct way to log ‘no value’ to Cacti? Should it not be null or something?

---

<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:** [February 20, 2014, 8:19am UTC](https://forums.percona.com/t/cacti-ssh-diskfree-returning-1-randomly-on-just-one-volume/3272/6 "2014-02-20T08:19:12Z")

</div>

There is no null for Cacti. 0 can mean a value of 0, but -1 can mean that something is wrong and worse to check…
