In a networked system, functionality can be seriously endangered when nodes are infected, due to internal random failures or a contagious virus that develops into an epidemic. Given a snapshot of the network representing the nodes states (infected or healthy), infection analysis refers to distinguishing an epidemic from random failures and gathering information for effective countermeasure design. This analysis is challenging due to irregular network structure, heterogeneous epidemic spreading, and noisy observations. This paper treats a network snapshot as a graph signal, and develops effective approaches for infection analysis based on graph signal processing. For the macro (network-level) analysis aiming to distinguish an epidemic from random failures, 1) multiple detection metrics are defined based on the graph Fourier transform (GFT) and neighborhood characteristics of the graph signal; 2) a new class of graph wavelets, distance-based graph wavelets (DBGWs), are developed; and 3) a machine learning-based framework is designed employing either the GFT spectrum or the graph wavelet coefficients as features for infection analysis. DBGWs also enable the micro (node-level) infection analysis, through which the performance of epidemic countermeasures can be improved. Extensive simulations are conducted to demonstrate the effectiveness of all the proposed algorithms in various network settings.