Detecting anomalies in a robot swarm play a core role in keeping the desired performance, and meeting requirements and specifications. This letter deals with the problem of detecting anomalies in a robot swarm. In this regards, an unsupervised monitoring approach based on principal component analysis and k-nearest neighbor is proposed. The principal component analysis model is employed to generate residuals for anomaly detection. Then, the residuals are examined by computing the proposed exponentially smoothed k-nearest neighbor statistic for the purpose of anomaly detection. Here, instead of using parametric thresholds derived based on the Gaussian distribution, a nonparametric decision threshold is computed using the kernel density estimation method. This provides more flexibility to the proposed detector by relaxing assumption on the distribution underlying the data. Tests on data from ARGoS simulator show efficient performance of the proposed mechanism in monitoring a robot swarm.