# How to avoid vgdisplay sudo rights error messages on hyps

**URL:** <https://forum.opennebula.io/t/how-to-avoid-vgdisplay-sudo-rights-error-messages-on-hyps/1710>\
**Category:** Product Support\
**Created:** [January 26, 2016, 8:59am UTC](https://forum.opennebula.io/t/how-to-avoid-vgdisplay-sudo-rights-error-messages-on-hyps/1710 "2016-01-26T08:59:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alvaro\_simongarcia](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/alvaro_simongarcia/32/4178_2.png) [@alvaro\_simongarcia](https://forum.opennebula.io/u/alvaro_simongarcia)\
**Post date:** [January 26, 2016, 8:59am UTC](https://forum.opennebula.io/t/how-to-avoid-vgdisplay-sudo-rights-error-messages-on-hyps/1710/1 "2016-01-26T08:59:33Z")

</div>

Hi

Since some time ago we have detected from our hyps secure logs several error messages like this:

> 2016-01-26T09:39:02.796813+01:00 hyp101 sudo: oneadmin : command not allowed ; TTY=unknown ; PWD=/var/tmp/one/im/kvm-probes.d ; USER=root ; COMMAND=/sbin/vgdisplay --separator : --units m -o vg\_size,vg\_free --nosuffix --noheadings -C vg-one-0

We only have a Ceph datastore, there is no FS LVM Datastore configured in our system but the kvm probes are still trying to check this (and sudo command fails).

How we can avoid these error messages from kvm-probes? Is this the expected behaviour or something is misconfigured?

Cheers and thanks!  
Alvaro

---

<div class="post-metadata">

**Author:** ![atodorov\_storpool](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/atodorov_storpool/32/5327_2.png) [@atodorov\_storpool](https://forum.opennebula.io/u/atodorov_storpool)\
**Post date:** [January 26, 2016, 10:01am UTC](https://forum.opennebula.io/t/how-to-avoid-vgdisplay-sudo-rights-error-messages-on-hyps/1710/2 "2016-01-26T10:01:38Z")

</div>

Hi Álvaro Simón,

The vgdisplay is called from /var/tmp/one/im/kvm-probes.d/monitor\_ds.sh which is (IMO) a little bit messy.

It is expecting the vgdisplay to be called from a non-root user (oneadmin) with sudo.

Another option is to tweak the test for vgdisplay check to fail always. Edit /var/tmp/one/im/kvm-probes.d/monitor\_ds.sh and replace(somewhere close to the 9-th row)

```auto
PATH=$PATH:/sbin:/bin:/usr/sbin:/usr/bin which vgdisplay &> /dev/null

```

to

```auto
PATH=$PATH:/sbin:/bin:/usr/sbin:/usr/bin which vgdisplay.enabled &> /dev/null

```

if you want to enable the lvm check for any reason just create symlink from `vgdislay` to `vgdisplay.enabled` 🙂

Kind Regards,  
Anton Todorov

---

<div class="post-metadata">

**Author:** ![alvaro\_simongarcia](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/alvaro_simongarcia/32/4178_2.png) [@alvaro\_simongarcia](https://forum.opennebula.io/u/alvaro_simongarcia)\
**Post date:** [January 26, 2016, 3:44pm UTC](https://forum.opennebula.io/t/how-to-avoid-vgdisplay-sudo-rights-error-messages-on-hyps/1710/3 "2016-01-26T15:44:30Z")

</div>

Hi Anton

Thanks for the workaround! 🙂 in any case monitor\_ds should perform some check only if that kind of datastore is available and configured in the system…

Cheers  
Álvaro

---

<div class="post-metadata">

**Author:** ![jmelis](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jmelis/32/24_2.png) [@jmelis](https://forum.opennebula.io/u/jmelis)\
**Post date:** [March 9, 2016, 11:20am UTC](https://forum.opennebula.io/t/how-to-avoid-vgdisplay-sudo-rights-error-messages-on-hyps/1710/4 "2016-03-09T11:20:38Z")

</div>

I agrree this could be improved. Any suggestions?

---

<div class="post-metadata">

**Author:** ![alvaro\_simongarcia](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/alvaro_simongarcia/32/4178_2.png) [@alvaro\_simongarcia](https://forum.opennebula.io/u/alvaro_simongarcia)\
**Post date:** [March 9, 2016, 1:24pm UTC](https://forum.opennebula.io/t/how-to-avoid-vgdisplay-sudo-rights-error-messages-on-hyps/1710/5 "2016-03-09T13:24:13Z")

</div>

Hi @jmelis

I was thinking about it, I didn’t check if is possible yet but maybe we can use the same mechanism that _tm_ scripts, parsing in this case `onedatastore list -x` output from _monitor\_ds_ without trying anything else before…  
In this case we are looking for any:

`<TM_MAD><![CDATA[lvm]]></TM_MAD>`  
or  
`<TM_MAD><![CDATA[fs_lvm]]></TM_MAD>`

and run the desired tests only if the TM\_MAD value is available in our conf, if not we avoid any undesired probe execution, this will also valid for any other specific datastore check.

As I said I didn’t try this yet, I think that I should use :  
`XPATH="${DRIVER_PATH}/../../datastore/xpath.rb --stdin"`  
to parse the XML output from _monitor\_ds_ bash script…

What do you think about this change? do you have another idea?

Cheers and thanks!  
Alvaro
