1

I have a Python script for checking backups. Part of the check is to check a file on a UNC share. The Python module win_unc is used to achieve this. Originally the script was mounting and disconnecting to the network share every time. I've changed this so that the server has the share mounted, and the script just connects to the share.

The code that connects to the share is as follows:

uncDir = UncDirectory(r'\\{}\backups'.format(dbsrv))
        uncc = UncDirectoryConnection(uncDir)
        uncc.connect()

I am still getting an error message though as follows, on the Nagios box which calls the script (Nagios => NRPE => NSClient++ => Python script):

<class 'win_unc.errors.ShellCommandError'>
()
The command `NET USE "\\X.X.X.X\backups" /PERSISTENT:NO` exited with error code 2.

I'm stumped as I have no idea why win_unc is trying to mount a network drive, as all I want it to do is to connect to an existing UNC share.

kafka
  • 553
  • 6
  • 19

0 Answers0