In our environment we are monitoring windows & Linux servers parameters in nagios, so due to network glitch/flap nagios server unable to communicate destination server because of that so much of services are giving "Socket time out error" in nagios and within 5-10 min again all services are working properly
To overcome this issue how can we add wrapper script in notification command to suppress the Socket timeout error alerts, also can we get the wrapper script too.
As a socket timeout is the same error you would receive for an actual problem I would highly discourage this approach.
Instead I would recommend you change the "Max check attempts" on these services to a higher value such as 10 so there are more retries before sending a notification.
Alternately, you could set the "First notification delay" setting on these object to something like 15 which will prevent a notification from goin out until 15 minutes after the first failure, if the object recovers in that time frame no notification will be sent out.