Any way of getting rid of this annoyance? Are they of danger to my pigs?
You may need at least a temporary layer of hardware cloth, wired to the more open grids, if this is what you are using for a cage.
Other people may have other opinions or advice.
If you are squeamish about sprung traps you can build a slightly more humane trap yourself out of a bucket, some string and a tin can and capture it to release elsewhere. Or if you put water in the bucket you can drown it but I am not sure that is much more humane.
Some things you can do to help get rid of them are; remove all readily available sources of food altogether. Anything they might get into should be secured in a place and in a way where they cannot get into it. Tupperware containers work well. Keep anything they might use for bedding picked up and put where they cannot get to it. They go after just about anything they can chew up for bedding. Basically you need to remove anything that makes your place hospitable.
Another choice and as a last resort is to get a cat. If you go that route, you will need to be extremely careful not to let it get to your guinea pigs. I have to watch things very carefully with mine. I had the cats long before we got the piggies. They have no interest in the piggies, but I don't take any chances. The presence of the cat may drive the rats out.
I think I should clarify that I didn't mean for anyone to get a cat just to take care of a rat or two or as a rent a cat. Cats are great pets just like guinea pigs. Our cats are just as well cared for and loved as our guinea pigs. They live a leisurely life and they come and go as they please. They come inside to eat, sleep, when they just want to be inside and when the weather prohibits them being outside. They're part of a cat community within the neighborhood. They are are neutered and they get regular checkups and shots.I guess I would not suggest getting a cat as a solution to taking care of a rat or two.
There's a giant field behind our neighborhood that is full of mice and they often find their way into the houses around here. In return for the love and care they get from us, they provide a valuable deterrent to the mice coming into this house. There is seldom just one rat or mouse. If you see one, there most likely a colony of them. Just one cat is all it takes to solve the problem. We saw traces of an old mouse infestation when we moved in 7 years ago but none since because we always have cats. It's a win-win.