Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diskusage beacons not sending events on Windows #51792

Closed
ghost opened this issue Feb 25, 2019 · 4 comments
Closed

diskusage beacons not sending events on Windows #51792

ghost opened this issue Feb 25, 2019 · 4 comments

Comments

@ghost
Copy link

ghost commented Feb 25, 2019

I am trying to setup a beacon to send disk usage events on Windows but I can't get it to work and can't see any event on master.

Setup

beacon.conf on the minion

  diskusage:
    - interval: 5
    - 'c:\\': 5%

I have tried with c://, c:, '*' and '^[a-zA-Z]:\$', and all sorts of percentage values.
I don't know what I missed?

Steps to Reproduce Issue

Running the minion on Windows with log

...
[DEBUG   ] Connecting the Minion to the Master URI (for the return server): tcp://10.200.31.145:4506
[DEBUG   ] Trying to connect to: tcp://10.200.31.145:4506
[INFO    ] Minion is ready to receive requests!
[DEBUG   ] Minion of 'salt.akld.net' is handling event tag '/salt/minion/minion_schedule_delete_complete'
[DEBUG   ] Minion of 'salt.akld.net' is handling event tag '/salt/minion/minion_schedule_add_complete'
[DEBUG   ] Minion of 'salt.akld.net' is handling event tag '/salt/minion/minion_schedule_delete_complete'
[DEBUG   ] Minion of 'salt.akld.net' is handling event tag '/salt/minion/minion_schedule_delete_complete'
[DEBUG   ] LazyLoaded diskusage.beacon

So the beacon is loaded and not failing.

But on the master, running salt-run state.event pretty=True

minion/refresh/win-slave-28-150 {
    "Minion data cache refresh": "win-slave-28-150",
    "_stamp": "2019-02-25T02:42:06.411818"
}
minion_start    {
    "_stamp": "2019-02-25T02:42:07.936309",
    "cmd": "_minion_event",
    "data": "Minion win-slave-28-150 started at Sun Feb 24 18:42:07 2019",
    "id": "win-slave-28-150",
    "pretag": null,
    "tag": "minion_start"
}
salt/minion/win-slave-28-150/start      {
    "_stamp": "2019-02-25T02:42:07.988995",
    "cmd": "_minion_event",
    "data": "Minion win-slave-28-150 started at Sun Feb 24 18:42:07 2019",
    "id": "win-slave-28-150",
    "pretag": null,
    "tag": "salt/minion/win-slave-28-150/start"
}

I have check and I have psutil installed on the minion :

....
    pip:
        9.0.1
    portend:
        2.2
    psutil:
        5.4.1
    pyOpenSSL:
        17.5.0
...

Versions Report

Master:

Salt Version:                                                         
           Salt: 2018.3.0                                             
                                                                      
Dependency Versions:                                                  
           cffi: Not Installed                                        
       cherrypy: Not Installed                                        
       dateutil: 2.4.2                                                
      docker-py: Not Installed                                        
          gitdb: 0.6.4                                                
      gitpython: 1.0.1                                                
          ioflo: Not Installed                                        
         Jinja2: 2.8                                                  
        libgit2: Not Installed                                        
        libnacl: Not Installed                                        
       M2Crypto: Not Installed                                        
           Mako: 1.0.3                                                
   msgpack-pure: Not Installed                                        
 msgpack-python: 0.4.6                                                
   mysql-python: Not Installed                                        
      pycparser: Not Installed                                        
       pycrypto: 2.6.1                                                
   pycryptodome: Not Installed                                        
         pygit2: Not Installed                                        
         Python: 2.7.12 (default, Nov 12 2018, 14:36:49)              
   python-gnupg: Not Installed                                        
         PyYAML: 3.11                                                 
          PyZMQ: 15.2.0                                               
           RAET: Not Installed                                        
          smmap: 0.9.0                                                
        timelib: Not Installed                                        
        Tornado: 4.2.1                                                
            ZMQ: 4.1.4                                                
                                                                      
System Versions:                                                      
           dist: Ubuntu 16.04 xenial                                  
         locale: UTF-8                                                
        machine: x86_64                                               
        release: 4.4.0-142-generic                                    
         system: Linux                                                
        version: Ubuntu 16.04 xenial                                  
                                                                      

Minion:

           Salt: 2018.3.0

Dependency Versions:
           cffi: 1.10.0
       cherrypy: 10.2.1
       dateutil: 2.6.1
      docker-py: Not Installed
          gitdb: 2.0.3
      gitpython: 2.1.7
          ioflo: Not Installed
         Jinja2: 2.10
        libgit2: Not Installed
        libnacl: 1.6.1
       M2Crypto: Not Installed
           Mako: 1.0.7
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: Not Installed
      pycparser: 2.18
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 64 bit (AMD64)]
   python-gnupg: 0.4.1
         PyYAML: 3.12
          PyZMQ: 16.0.3
           RAET: Not Installed
          smmap: 2.0.3
        timelib: 0.2.4
        Tornado: 4.5.2
            ZMQ: 4.1.6

System Versions:
           dist:
         locale: cp1252
        machine: AMD64
        release: 10
         system: Windows
        version: 10 10.0.15063  Multiprocessor Free
@ghost ghost changed the title diskusage beacons not sending events diskusage beacons not sending events on Windows Feb 25, 2019
@twangboy
Copy link
Contributor

twangboy commented Feb 25, 2019

@maxime-viargues-serato The documentation shows c:\\ for Windows

https://docs.saltstack.com/en/latest/ref/beacons/all/salt.beacons.diskusage.html#salt.beacons.diskusage.beacon

@twangboy
Copy link
Contributor

OK, I was able to get it to work with 'C:\'

@ghost
Copy link
Author

ghost commented Feb 25, 2019

Oh okay, I managed to make it work using 'C:\\' it is case sensitive then...
Interesting I tried 'C:\' but it fails with an exception error: bogus escape (end of line)

It would be good to update the documentation. Even the regex from the documentation doesn't work, I get a [WARNING ] ^[a-zA-Z]:\\$ is not a valid mount point. which at least displays something.
It would be great to show a warning if no mount point matches the expression so at least we know the beacon is not going to do anything.

Thank you.

@twangboy
Copy link
Contributor

twangboy commented Feb 25, 2019

The above PR should take care of this. It should fix the capitalization issue and allow single or double slashes... It handles the regex version as well, with single or double slashes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant