The irregular satellites of the giant planets are believed to have been captured during the evolution of the solar system. Knowing their physical parameters, such as size, density, and albedo is important for constraining where they came from and how they were captured. The best way to obtain these parameters are observations in situ by spacecrafts or from stellar occultations by the objects. Both techniques demand that the orbits are well known. We aimed to obtain good astrometric positions of irregular satellites to improve their orbits and ephemeris. We identified and reduced observations of several irregular satellites from three databases containing more than 8000 images obtained between 1992 and 2014 at three sites (Observatorio do Pico dos Dias, Observatoire de Haute-Provence, and European Southern Observatory - La Silla). We used the software PRAIA (Platform for Reduction of Astronomical Images Automatically) to make the astrometric reduction of the CCD frames. The UCAC4 catalog represented the International Celestial Reference System in the reductions. Identification of the satellites in the frames was done through their ephemerides as determined from the SPICE/NAIF kernels. Some procedures were followed to overcome missing or incomplete information (coordinates, date), mostly for the older images. We managed to obtain more than 6000 positions for 18 irregular satellites: 12 of Jupiter, 4 of Saturn, 1 of Uranus (Sycorax), and 1 of Neptune (Nereid). For some satellites the number of obtained positions is more than 50% of what was used in earlier orbital numerical integrations. Comparison of our positions with recent JPL ephemeris suggests there are systematic errors in the orbits for some of the irregular satellites. The most evident case was an error in the inclination of Carme.