I will talk about restricted modules over a class of $\frac12\mathbb Z$-graded Lie algebras $\mathfrak g$ related to the Virasoro algebra. We in fact give the classification of certain irreducible restricted $\mathfrak g$-modules in the sense of determining each irreducible restricted module up to an irreducible module over a subalgebra of $\mathfrak g$ which contains its positive part. By the correspondence between restricted modules over $\mathfrak g$ and modules over the vertex algebra associated to $\mathfrak g$, we get the classification of certain irreducible modules over vertex algebras associated to these $\mathfrak g.$