Those look like Box Elder Bugs. If so, they're harmless.
Are you sure you didn't have squash bugs? They look kinda like box elder bugs except they are brownish gray and black instead of red/black. Also, they like cucurbits which would explain their fondness for cucumbers.
I had these exact bugs, and I had squash bugs too.