Blame view

check_smart/auxiliar.h 729 Bytes
Imanol-Mikel Barba Sabariego authored
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//
// Created by Imanol on 28-may-16.
//

#ifndef NAGIOS_PLUGINS_AUXILIAR_H
#define NAGIOS_PLUGINS_AUXILIAR_H

#include <sstream>
#include <iostream>
#include <exception>

#include <stdlib.h>
#include <stdio.h>
#include <signal.h>

using namespace std;
18
extern const char *servicename;
Imanol-Mikel Barba Sabariego authored
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

int str2int(string str);
string int2str(int x);
int exec(string cmd, string *output);
void timer_handler (int signum);

class integerConversionException : public exception
{
private:
    string s;
public:
    integerConversionException(std::string ss) : s(ss) {}
    ~integerConversionException() throw () {}
    const char* what() const throw() { return s.c_str(); }
};

#endif //NAGIOS_PLUGINS_AUXILIAR_H